Skip to content

refactor: mempool: use CTxMemPool::Limits

Mempool currently considers 4 limits regarding ancestor and descendant count and size, which get passed around between functions quite a bit. This PR uses CTxMemPool::Limits introduced in https://github.com/bitcoin/bitcoin/pull/25290 to simplify those signatures and callsites.

The purpose of this PR is to improve readability and maintenance, without behaviour change.

As noted in the first commit "refactor: mempool: change MemPoolLimits members to uint", we currently have an underflow issue where a user could pass a negative -limitancestorsize, which is eventually cast to an unsigned integer. This behaviour already exists. Because it's orthogonal and to minimize scope, I think this should be fixed in a separate PR.

Merge request reports

Loading