mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 11:57:28 -03:00
refactor: mempool: add MemPoolLimits::NoLimits()
There are quite a few places in the codebase that require us to construct a CTxMemPool without limits on ancestors and descendants. This helper function allows us to get rid of all that duplication.
This commit is contained in:
parent
2d8d9aecac
commit
b85af25f87
1 changed files with 9 additions and 0 deletions
|
@ -24,6 +24,15 @@ struct MemPoolLimits {
|
|||
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};
|
||||
|
||||
/**
|
||||
* @return MemPoolLimits with all the limits set to the maximum
|
||||
*/
|
||||
static constexpr MemPoolLimits NoLimits()
|
||||
{
|
||||
int64_t no_limit{std::numeric_limits<int64_t>::max()};
|
||||
return {no_limit, no_limit, no_limit, no_limit};
|
||||
}
|
||||
};
|
||||
} // namespace kernel
|
||||
|
||||
|
|
Loading…
Reference in a new issue