aboutsummaryrefslogtreecommitdiff
path: root/src/kernel
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2021-10-28 14:13:04 -0400
committerCarl Dong <contact@carldong.me>2022-06-28 15:42:23 -0400
commitaa9141cd8185cb7ad532bc16feb9d302b05d9697 (patch)
tree18dad4b3fcdeb21bcfd473528e1764a78fffd2b9 /src/kernel
parent51c7a41a5eb6fcb60333812c770d80227cf7b64d (diff)
downloadbitcoin-aa9141cd8185cb7ad532bc16feb9d302b05d9697.tar.xz
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)}
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/mempool_options.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/mempool_options.h b/src/kernel/mempool_options.h
index e8c129050e..35621e1a28 100644
--- a/src/kernel/mempool_options.h
+++ b/src/kernel/mempool_options.h
@@ -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