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.5#ifndef BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H6#define BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H8#include <kernel/notifications_interface.h>10#include <arith_uint256.h>11#include <dbwrapper.h>12#include <script/sigcache.h>13#include <txdb.h>14#include <uint256.h>15#include <util/time.h>17#include <cstdint>18#include <functional>19#include <optional>21class CChainParams;22class ValidationSignals;24inline constexpr auto DEFAULT_MAX_TIP_AGE{24h};25inline constexpr int32_t DEFAULT_PREVOUTFETCH_THREADS{8};27namespace kernel {29/**30* An options struct for `ChainstateManager`, more ergonomically referred to as31* `ChainstateManager::Options` due to the using-declaration in32* `ChainstateManager`.33*/34struct ChainstateManagerOpts {35const CChainParams& chainparams;36fs::path datadir;37std::optional<int32_t> check_block_index{};38//! If set, it will override the minimum work we will assume exists on some valid chain.39std::optional<arith_uint256> minimum_chain_work{};40//! If set, it will override the block hash whose ancestors we will assume to have valid scripts without checking them.41std::optional<uint256> assumed_valid_block{};42//! If the tip is older than this, the node is considered to be in initial block download.43std::chrono::seconds max_tip_age{DEFAULT_MAX_TIP_AGE};44DBOptions coins_db{};45CoinsViewOptions coins_view{};46Notifications& notifications;47ValidationSignals* signals{nullptr};48//! Number of script check worker threads. Zero means no parallel verification.49int worker_threads_num{0};50//! Number of worker threads used for prefetching block input prevouts. Zero means no parallel fetching.51int32_t prevoutfetch_threads_num{DEFAULT_PREVOUTFETCH_THREADS};52size_t script_execution_cache_bytes{DEFAULT_SCRIPT_EXECUTION_CACHE_BYTES};53size_t signature_cache_bytes{DEFAULT_SIGNATURE_CACHE_BYTES};54};56} // namespace kernel58#endif // BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H