mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-16 16:11:47 +02: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
@ -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…
x
Reference in New Issue
Block a user