Inside Bitcoin
Opening the selected file…
Inside Bitcoin
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_OPTIONS_H5#define BITCOIN_KERNEL_MEMPOOL_OPTIONS_H7#include <kernel/mempool_limits.h>9#include <policy/feerate.h>10#include <policy/policy.h>11#include <util/time.h>13#include <cstdint>14#include <optional>16class ValidationSignals;18/** Default for -maxmempool, maximum megabytes of mempool memory usage */19inline constexpr unsigned int DEFAULT_MAX_MEMPOOL_SIZE_MB{300};20/** Default for -maxmempool when blocksonly is set */21inline constexpr unsigned int DEFAULT_BLOCKSONLY_MAX_MEMPOOL_SIZE_MB{5};22/** Default for -mempoolexpiry, expiration time for mempool transactions in hours */23inline constexpr unsigned int DEFAULT_MEMPOOL_EXPIRY_HOURS{336};24/** Whether to fall back to legacy V1 serialization when writing mempool.dat */25inline constexpr bool DEFAULT_PERSIST_V1_DAT{false};26/** Default for -acceptnonstdtxn */27inline constexpr bool DEFAULT_ACCEPT_NON_STD_TXN{false};29namespace kernel {30/**31* Options struct containing options for constructing a CTxMemPool. Default32* constructor populates the struct with sane default values which can be33* modified.34*35* Most of the time, this struct should be referenced as CTxMemPool::Options.36*/37struct MemPoolOptions {38/* The ratio used to determine how often sanity checks will run. */39int check_ratio{0};40int64_t max_size_bytes{DEFAULT_MAX_MEMPOOL_SIZE_MB * 1'000'000};41std::chrono::seconds expiry{std::chrono::hours{DEFAULT_MEMPOOL_EXPIRY_HOURS}};42CFeeRate incremental_relay_feerate{DEFAULT_INCREMENTAL_RELAY_FEE};43/** A fee rate smaller than this is considered zero fee (for relaying, mining and transaction creation) */44CFeeRate min_relay_feerate{DEFAULT_MIN_RELAY_TX_FEE};45CFeeRate dust_relay_feerate{DUST_RELAY_TX_FEE};46/**47* A data carrying output is an unspendable output containing data. The script48* type is designated as TxoutType::NULL_DATA.49*50* Maximum size of TxoutType::NULL_DATA scripts that this node considers standard.51* If nullopt, any size is nonstandard.52*/53std::optional<unsigned> max_datacarrier_bytes{DEFAULT_ACCEPT_DATACARRIER ? std::optional{MAX_OP_RETURN_RELAY} : std::nullopt};54bool permit_bare_multisig{DEFAULT_PERMIT_BAREMULTISIG};55bool require_standard{true};56bool persist_v1_dat{DEFAULT_PERSIST_V1_DAT};57MemPoolLimits limits{};59ValidationSignals* signals{nullptr};60};61} // namespace kernel63#endif // BITCOIN_KERNEL_MEMPOOL_OPTIONS_H