mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
mempool: Pass in -mempoolexpiry instead of referencing gArgs
- Store the mempool expiry (-mempoolexpiry) in CTxMemPool as a
std::chrono::seconds member.
- Remove the requirement to explicitly specify a mempool expiry for
LimitMempoolSize(...), just use the newly-introduced member.
- Remove all now-unnecessary instances of:
std::chrono::hours{gArgs.GetIntArg("-mempoolexpiry", DEFAULT_MEMPOOL_EXPIRY)}
This commit is contained in:
@@ -4,12 +4,15 @@
|
||||
#ifndef BITCOIN_KERNEL_MEMPOOL_OPTIONS_H
|
||||
#define BITCOIN_KERNEL_MEMPOOL_OPTIONS_H
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
|
||||
class CBlockPolicyEstimator;
|
||||
|
||||
/** Default for -maxmempool, maximum megabytes of mempool memory usage */
|
||||
static constexpr unsigned int DEFAULT_MAX_MEMPOOL_SIZE_MB{300};
|
||||
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
|
||||
static constexpr unsigned int DEFAULT_MEMPOOL_EXPIRY{336};
|
||||
|
||||
namespace kernel {
|
||||
/**
|
||||
@@ -25,6 +28,7 @@ struct MemPoolOptions {
|
||||
/* The ratio used to determine how often sanity checks will run. */
|
||||
int check_ratio{0};
|
||||
int64_t max_size_bytes{DEFAULT_MAX_MEMPOOL_SIZE_MB * 1'000'000};
|
||||
std::chrono::seconds expiry{std::chrono::hours{DEFAULT_MEMPOOL_EXPIRY}};
|
||||
};
|
||||
} // namespace kernel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user