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:
Carl Dong
2021-10-28 14:13:04 -04:00
parent 51c7a41a5e
commit aa9141cd81
6 changed files with 15 additions and 13 deletions

View File

@@ -59,8 +59,6 @@ namespace Consensus {
struct Params;
} // namespace Consensus
/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */
static const unsigned int DEFAULT_MEMPOOL_EXPIRY = 336;
/** Maximum number of dedicated script-checking threads allowed */
static const int MAX_SCRIPTCHECK_THREADS = 15;
/** -par default (number of script-checking threads, 0 = auto) */