diff options
author | Carl Dong <contact@carldong.me> | 2022-05-18 14:44:25 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2022-06-28 15:49:15 -0400 |
commit | 6c5c60c4124293d948735756f84efc85262ea66f (patch) | |
tree | 65d8b406df73768dfc440731258f44f6ee2c513a /src/kernel/mempool_limits.h | |
parent | 9e93b1030182eff92ef91181e17c7dd498c7e164 (diff) | |
download | bitcoin-6c5c60c4124293d948735756f84efc85262ea66f.tar.xz |
mempool: Use m_limit for UpdateTransactionsFromBlock
Since:
- UpdateTransactionsFromBlock is only called by
MaybeUpdateMempoolForReorg, which calls it with the gArgs-determined
ancestor limits
- UpdateForDescendants is only called by UpdateTransactionsFromBlock
with the ancestor limits unchanged
We can remove the requirement to specify the ancestor limits for both
UpdateTransactionsFromBlock and UpdateForDescendants and just use the
values in the m_limits member.
Also move some removed comments to MemPoolLimits struct members.
The uint64_t cast in UpdateForDescendants is not new behavior,
see the diff in CChainState::MaybeUpdateMempoolForReorg for where they
were previously.
Diffstat (limited to 'src/kernel/mempool_limits.h')
-rw-r--r-- | src/kernel/mempool_limits.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kernel/mempool_limits.h b/src/kernel/mempool_limits.h index 083e9681e7..e192e7e6cd 100644 --- a/src/kernel/mempool_limits.h +++ b/src/kernel/mempool_limits.h @@ -16,9 +16,13 @@ namespace kernel { * Most of the time, this struct should be referenced as CTxMemPool::Limits. */ struct MemPoolLimits { + //! The maximum allowed number of transactions in a package including the entry and its ancestors. int64_t ancestor_count{DEFAULT_ANCESTOR_LIMIT}; + //! The maximum allowed size in virtual bytes of an entry and its ancestors within a package. int64_t ancestor_size_vbytes{DEFAULT_ANCESTOR_SIZE_LIMIT_KVB * 1'000}; + //! The maximum allowed number of transactions in a package including the entry and its descendants. int64_t descendant_count{DEFAULT_DESCENDANT_LIMIT}; + //! The maximum allowed size in virtual bytes of an entry and its descendants within a package. int64_t descendant_size_vbytes{DEFAULT_DESCENDANT_SIZE_LIMIT_KVB * 1'000}; }; } // namespace kernel |