Bitcoin Core 28.99.0
P2P Digital Currency
chainstate.h
Go to the documentation of this file.
1// Copyright (c) 2021-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_NODE_CHAINSTATE_H
6#define BITCOIN_NODE_CHAINSTATE_H
7
8#include <util/translation.h>
9#include <validation.h>
10
11#include <cstdint>
12#include <functional>
13#include <tuple>
14
15class CTxMemPool;
16
17namespace kernel {
18struct CacheSizes;
19} // namespace kernel
20
21namespace node {
22
26 bool coins_db_in_memory{false};
27 // Whether to wipe the block tree database when loading it. If set, this
28 // will also set a reindexing flag so any existing block data files will be
29 // scanned and added to the database.
30 bool wipe_block_tree_db{false};
31 // Whether to wipe the chainstate database when loading it. If set, this
32 // will cause the chainstate database to be rebuilt starting from genesis.
33 bool wipe_chainstate_db{false};
34 bool prune{false};
42 std::function<void()> coins_error_cb;
43};
44
50 SUCCESS,
51 FAILURE,
56};
57
59using ChainstateLoadResult = std::tuple<ChainstateLoadStatus, bilingual_str>;
60
75 const ChainstateLoadOptions& options);
77} // namespace node
78
79#endif // BITCOIN_NODE_CHAINSTATE_H
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition: txmempool.h:304
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
Definition: validation.h:866
Definition: messages.h:20
ChainstateLoadStatus
Chainstate load status.
Definition: chainstate.h:49
@ FAILURE_FATAL
Fatal error which should not prompt to reindex.
@ FAILURE
Generic failure which reindexing may fix.
std::tuple< ChainstateLoadStatus, bilingual_str > ChainstateLoadResult
Chainstate load status code and optional error string.
Definition: chainstate.h:59
ChainstateLoadResult LoadChainstate(ChainstateManager &chainman, const CacheSizes &cache_sizes, const ChainstateLoadOptions &options)
Definition: chainstate.cpp:175
ChainstateLoadResult VerifyLoadedChainstate(ChainstateManager &chainman, const ChainstateLoadOptions &options)
Definition: chainstate.cpp:260
bool require_full_verification
Setting require_full_verification to true will require all checks at check_level (below) to succeed f...
Definition: chainstate.h:39
std::function< void()> coins_error_cb
Definition: chainstate.h:42
static constexpr int DEFAULT_CHECKLEVEL
Definition: validation.h:70
static const signed int DEFAULT_CHECKBLOCKS
Definition: validation.h:69