Bitcoin ABC 0.33.10
P2P Digital Currency
chainstatemanager_opts.h
Go to the documentation of this file.
1// Copyright (c) 2022 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H
6#define BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H
7
9
10#include <arith_uint256.h>
11#include <avalanche/avalanche.h>
12#include <dbwrapper.h>
14#include <script/scriptcache.h>
15#include <script/sigcache.h>
16#include <txdb.h>
17#include <util/time.h>
18
19#include <cstdint>
20#include <functional>
21#include <optional>
22
23class Config;
24
25static constexpr bool DEFAULT_CHECKPOINTS_ENABLED{true};
26static constexpr auto DEFAULT_MAX_TIP_AGE{24h};
27static constexpr bool DEFAULT_STORE_RECENT_HEADERS_TIME{false};
28static constexpr bool DEFAULT_PARK_DEEP_REORG{true};
29
30namespace kernel {
31
38 const Config &config;
41 nullptr};
42 std::optional<bool> check_block_index{};
48 std::optional<arith_uint256> minimum_chain_work{};
51 std::optional<BlockHash> assumed_valid_block{};
54 std::chrono::seconds max_tip_age{DEFAULT_MAX_TIP_AGE};
66 std::optional<int64_t> replay_protection_activation_time{};
67
71};
72
73} // namespace kernel
74
75#endif // BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H
static constexpr bool AVALANCHE_DEFAULT_ENABLED
Is avalanche enabled by default.
Definition: avalanche.h:15
static constexpr bool DEFAULT_CHECKPOINTS_ENABLED
static constexpr auto DEFAULT_MAX_TIP_AGE
static constexpr bool DEFAULT_STORE_RECENT_HEADERS_TIME
static constexpr bool DEFAULT_PARK_DEEP_REORG
Definition: config.h:19
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...
Definition: fs.h:30
A base class defining functions for notifying about certain kernel events.
Definition: init.h:28
static constexpr size_t DEFAULT_SCRIPT_EXECUTION_CACHE_BYTES
Definition: scriptcache.h:102
static constexpr size_t DEFAULT_SIGNATURE_CACHE_BYTES
Definition: sigcache.h:26
User-controlled performance and debug options.
Definition: txdb.h:40
User-controlled performance and debug options.
Definition: dbwrapper.h:26
std::chrono::time_point< NodeClock > time_point
Definition: time.h:21
An options struct for ChainstateManager, more ergonomically referred to as ChainstateManager::Options...
const std::function< NodeClock::time_point()> adjusted_time_callback
std::optional< bool > check_block_index
std::optional< arith_uint256 > minimum_chain_work
If set, it will override the minimum work we will assume exists on some valid chain.
std::chrono::seconds max_tip_age
If the tip is older than this, the node is considered to be in initial block download.
std::optional< BlockHash > assumed_valid_block
If set, it will override the block hash whose ancestors we will assume to have valid scripts without ...
int worker_threads_num
Number of script check worker threads.
bool store_recent_headers_time
If set, store and load the last few block headers reception time to speed up RTT bootstraping.
std::optional< int64_t > replay_protection_activation_time
If set, this overwrites the timestamp at which replay protection activates.