Inside Bitcoin
Opening the selected file…
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2022-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or http://www.opensource.org/licenses/mit-license.php.4#ifndef BITCOIN_KERNEL_MEMPOOL_LIMITS_H5#define BITCOIN_KERNEL_MEMPOOL_LIMITS_H7#include <policy/policy.h>9#include <cstdint>11namespace kernel {12/**13* Options struct containing limit options for a CTxMemPool. Default constructor14* populates the struct with sane default values which can be modified.15*16* Most of the time, this struct should be referenced as CTxMemPool::Limits.17*/18struct MemPoolLimits {19//! The maximum number of transactions in a cluster20unsigned cluster_count{DEFAULT_CLUSTER_LIMIT};21//! The maximum allowed size in virtual bytes of a cluster.22int64_t cluster_size_vbytes{DEFAULT_CLUSTER_SIZE_LIMIT_KVB * 1'000};23//! The maximum allowed number of transactions in a package including the entry and its ancestors.24int64_t ancestor_count{DEFAULT_ANCESTOR_LIMIT};25//! The maximum allowed number of transactions in a package including the entry and its descendants.26int64_t descendant_count{DEFAULT_DESCENDANT_LIMIT};28/**29* @return MemPoolLimits with all the limits set to the maximum30*/31static constexpr MemPoolLimits NoLimits()32{33int64_t no_limit{std::numeric_limits<int64_t>::max()};34return {std::numeric_limits<unsigned>::max(), no_limit, no_limit, no_limit};35}36};37} // namespace kernel39#endif // BITCOIN_KERNEL_MEMPOOL_LIMITS_H