HomePhabricator

mempool: Pass in -mempoolexpiry instead of referencing gArgs

Description

mempool: Pass in -mempoolexpiry instead of referencing gArgs

Summary:

  • 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)}
  • Rename DEFAULT_MEMPOOL_EXPIRY to indicate time unit

This is a partial backport of core#25290
https://github.com/bitcoin/bitcoin/pull/25290/commits/aa9141cd8185cb7ad532bc16feb9d302b05d9697
https://github.com/bitcoin/bitcoin/pull/25290/commits/1ecc77321deb61b9f6888e4e10752b9d972fd26e

Depends on D15300

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

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

Details

Provenance
Carl Dong <contact@carldong.me>Authored on Oct 28 2021, 18:13
PiRKCommitted on Jan 30 2024, 09:35
PiRKPushed on Jan 30 2024, 09:35
Reviewer
Restricted Project
Differential Revision
D15301: mempool: Pass in -mempoolexpiry instead of referencing gArgs
Parents
rABCd589d6500c6d: mempool: Pass in -maxmempool instead of referencing gArgs
Branches
Unknown
Tags
Unknown