Page MenuHomePhabricator

mempool: Pass in -maxmempool instead of referencing gArgs
ClosedPublic

Authored by PiRK on Jan 26 2024, 16:10.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCd589d6500c6d: 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

Event Timeline

PiRK requested review of this revision.Jan 26 2024, 16:10
This revision is now accepted and ready to land.Jan 26 2024, 19:57