Bitcoin ABC  0.26.3
P2P Digital Currency
chainstate.h
Go to the documentation of this file.
1 // Copyright (c) 2021 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_NODE_CHAINSTATE_H
6 #define BITCOIN_NODE_CHAINSTATE_H
7 
8 #include <cstdint>
9 #include <functional>
10 #include <optional>
11 
12 struct bilingual_str;
13 class Config;
14 class ChainstateManager;
15 class CTxMemPool;
16 namespace Consensus {
17 struct Params;
18 } // namespace Consensus
19 
20 namespace node {
32 };
33 
61 std::optional<ChainstateLoadingError>
62 LoadChainstate(bool fReset, ChainstateManager &chainman, CTxMemPool *mempool,
63  bool fPruneMode, const Consensus::Params &consensus_params,
64  bool fReindexChainState, int64_t nBlockTreeDBCache,
65  int64_t nCoinDBCache, int64_t nCoinCacheUsage,
66  bool block_tree_db_in_memory, bool coins_db_in_memory,
67  std::function<bool()> shutdown_requested = nullptr,
68  std::function<void()> coins_error_cb = nullptr);
69 
74 };
75 
76 std::optional<ChainstateLoadVerifyError>
77 VerifyLoadedChainstate(ChainstateManager &chainman, bool fReset,
78  bool fReindexChainState, const Config &config,
79  unsigned int check_blocks, unsigned int check_level,
80  std::function<int64_t()> get_unix_time_seconds);
81 } // namespace node
82 
83 #endif // BITCOIN_NODE_CHAINSTATE_H
const CChainParams & Params()
Return the currently selected parameters.
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:355
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition: validation.h:1062
Definition: config.h:17
Definition: init.h:28
bool fPruneMode
Pruning-related variables and constants.
ChainstateLoadVerifyError
Definition: chainstate.h:70
std::optional< ChainstateLoadVerifyError > VerifyLoadedChainstate(ChainstateManager &chainman, bool fReset, bool fReindexChainState, const Config &config, unsigned int check_blocks, unsigned int check_level, std::function< int64_t()> get_unix_time_seconds)
Definition: chainstate.cpp:135
std::optional< ChainstateLoadingError > LoadChainstate(bool fReset, ChainstateManager &chainman, CTxMemPool *mempool, bool fPruneMode_, const Consensus::Params &consensus_params, bool fReindexChainState, int64_t nBlockTreeDBCache, int64_t nCoinDBCache, int64_t nCoinCacheUsage, bool block_tree_db_in_memory, bool coins_db_in_memory, std::function< bool()> shutdown_requested, std::function< void()> coins_error_cb)
This sequence can have 4 types of outcomes:
Definition: chainstate.cpp:14
ChainstateLoadingError
Definition: chainstate.h:21
Parameters that influence chain consensus.
Definition: params.h:33
Bilingual messages:
Definition: translation.h:17