Bitcoin ABC  0.29.3
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 
8 #include <arith_uint256.h>
9 #include <primitives/blockhash.h>
10 #include <util/time.h>
11 
12 #include <cstdint>
13 #include <functional>
14 #include <optional>
15 
16 class Config;
17 
18 static constexpr bool DEFAULT_CHECKPOINTS_ENABLED{true};
19 static constexpr auto DEFAULT_MAX_TIP_AGE{24h};
20 
21 namespace kernel {
22 
29  const Config &config;
31  nullptr};
32  std::optional<bool> check_block_index{};
36  std::optional<arith_uint256> minimum_chain_work{};
39  std::optional<BlockHash> assumed_valid_block{};
42  std::chrono::seconds max_tip_age{DEFAULT_MAX_TIP_AGE};
43 };
44 
45 } // namespace kernel
46 
47 #endif // BITCOIN_KERNEL_CHAINSTATEMANAGER_OPTS_H
static constexpr bool DEFAULT_CHECKPOINTS_ENABLED
static constexpr auto DEFAULT_MAX_TIP_AGE
Definition: config.h:17
std::chrono::time_point< NodeClock > time_point
Definition: time.h:19
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 ...