HomePhabricator

mempool: Pass in -maxmempool instead of referencing gArgs

Description

mempool: Pass in -maxmempool instead of referencing gArgs

Summary:

  • 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.

Now that MemPoolOptions has a correctly-determined max_size member, use
that instead of redetermining it to print the log line.

This is a partial backport of core#25290
https://github.com/bitcoin/bitcoin/pull/25290/commits/82f00de7a6a60cbc9ad0c6e1d0ffb1bc70c49af5
https://github.com/bitcoin/bitcoin/pull/25290/commits/51c7a41a5eb6fcb60333812c770d80227cf7b64d

Depends on D15299

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D15300

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Oct 28 2021, 17:46
PiRKCommitted on Jan 30 2024, 09:35
PiRKPushed on Jan 30 2024, 09:35
Reviewer
Restricted Project
Differential Revision
D15300: mempool: Pass in -maxmempool instead of referencing gArgs
Parents
rABCba26a00e7ace: pool: Add and use MemPoolOptions, ApplyArgsManOptions
Branches
Unknown
Tags
Unknown