diff options
author | Carl Dong <contact@carldong.me> | 2021-10-28 13:46:19 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-06-28 15:36:18 -0400 |
commit | 82f00de7a6a60cbc9ad0c6e1d0ffb1bc70c49af5 (patch) | |
tree | 1a034d8f11035bf508c82a9cac2c8d935c648d03 /src/mempool_args.cpp | |
parent | f1941e8bfd2eecc478c7660434b1ebf6a64095a0 (diff) | |
download | bitcoin-82f00de7a6a60cbc9ad0c6e1d0ffb1bc70c49af5.tar.xz |
mempool: Pass in -maxmempool instead of referencing gArgs
- Store the mempool size limit (-maxmempool) in CTxMemPool as a member.
- Remove the requirement to explicitly specify a mempool size limit for
CTxMemPool::GetMinFee(...) and LimitMempoolSize(...), just use the
stored mempool size limit where possible.
- Remove all now-unnecessary instances of:
gArgs.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE_MB) * 1000000
The code change in CChainState::GetCoinsCacheSizeState() is correct
since the coinscache should not repurpose "extra" mempool memory
headroom for itself if the mempool doesn't even exist.
Diffstat (limited to 'src/mempool_args.cpp')
-rw-r--r-- | src/mempool_args.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mempool_args.cpp b/src/mempool_args.cpp index 578463b81a..aef4e478f3 100644 --- a/src/mempool_args.cpp +++ b/src/mempool_args.cpp @@ -13,4 +13,6 @@ using kernel::MemPoolOptions; void ApplyArgsManOptions(const ArgsManager& argsman, MemPoolOptions& mempool_opts) { mempool_opts.check_ratio = argsman.GetIntArg("-checkmempool", mempool_opts.check_ratio); + + if (auto mb = argsman.GetIntArg("-maxmempool")) mempool_opts.max_size_bytes = *mb * 1'000'000; } |