Bitcoin Core
31.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
node
chainstate.h
Go to the documentation of this file.
1
// Copyright (c) 2021-present 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
15
class
CTxMemPool
;
16
17
namespace
kernel
{
18
struct
CacheSizes
;
19
}
// namespace kernel
20
21
namespace
node
{
22
23
struct
ChainstateLoadOptions
{
24
CTxMemPool
*
mempool
{
nullptr
};
25
bool
coins_db_in_memory
{
false
};
26
// Whether to wipe the chainstate database when loading it. If set, this
27
// will cause the chainstate database to be rebuilt starting from genesis.
28
bool
wipe_chainstate_db
{
false
};
29
bool
prune
{
false
};
34
bool
require_full_verification
{
true
};
35
int64_t
check_blocks
{
DEFAULT_CHECKBLOCKS
};
36
int64_t
check_level
{
DEFAULT_CHECKLEVEL
};
37
std::function<void()>
coins_error_cb
;
38
};
39
44
enum class
ChainstateLoadStatus
{
45
SUCCESS
,
46
FAILURE
,
47
FAILURE_FATAL
,
48
FAILURE_INCOMPATIBLE_DB
,
49
FAILURE_INSUFFICIENT_DBCACHE
,
50
INTERRUPTED
,
51
};
52
54
using
ChainstateLoadResult
= std::tuple<ChainstateLoadStatus, bilingual_str>;
55
69
ChainstateLoadResult
LoadChainstate
(
ChainstateManager
& chainman,
const
kernel::CacheSizes
& cache_sizes,
70
const
ChainstateLoadOptions
& options);
71
ChainstateLoadResult
VerifyLoadedChainstate
(
ChainstateManager
& chainman,
const
ChainstateLoadOptions
& options);
72
}
// namespace node
73
74
#endif
// BITCOIN_NODE_CHAINSTATE_H
CTxMemPool
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Definition
txmempool.h:187
ChainstateManager
Interface for managing multiple Chainstate objects, where each chainstate is associated with chainsta...
Definition
validation.h:940
kernel
Definition
coinstatsindex.h:21
node
Definition
messages.h:21
node::ChainstateLoadStatus
ChainstateLoadStatus
Definition
chainstate.h:44
node::ChainstateLoadStatus::FAILURE_INCOMPATIBLE_DB
@ FAILURE_INCOMPATIBLE_DB
Definition
chainstate.h:48
node::ChainstateLoadStatus::FAILURE_FATAL
@ FAILURE_FATAL
Fatal error which should not prompt to reindex.
Definition
chainstate.h:47
node::ChainstateLoadStatus::FAILURE
@ FAILURE
Generic failure which reindexing may fix.
Definition
chainstate.h:46
node::ChainstateLoadStatus::INTERRUPTED
@ INTERRUPTED
Definition
chainstate.h:50
node::ChainstateLoadStatus::FAILURE_INSUFFICIENT_DBCACHE
@ FAILURE_INSUFFICIENT_DBCACHE
Definition
chainstate.h:49
node::ChainstateLoadStatus::SUCCESS
@ SUCCESS
Definition
chainstate.h:45
node::ChainstateLoadResult
std::tuple< ChainstateLoadStatus, bilingual_str > ChainstateLoadResult
Chainstate load status code and optional error string.
Definition
chainstate.h:54
node::LoadChainstate
ChainstateLoadResult LoadChainstate(ChainstateManager &chainman, const CacheSizes &cache_sizes, const ChainstateLoadOptions &options)
Definition
chainstate.cpp:151
node::VerifyLoadedChainstate
ChainstateLoadResult VerifyLoadedChainstate(ChainstateManager &chainman, const ChainstateLoadOptions &options)
Definition
chainstate.cpp:240
kernel::CacheSizes
Definition
caches.h:23
node::ChainstateLoadOptions
Definition
chainstate.h:23
node::ChainstateLoadOptions::wipe_chainstate_db
bool wipe_chainstate_db
Definition
chainstate.h:28
node::ChainstateLoadOptions::mempool
CTxMemPool * mempool
Definition
chainstate.h:24
node::ChainstateLoadOptions::coins_db_in_memory
bool coins_db_in_memory
Definition
chainstate.h:25
node::ChainstateLoadOptions::require_full_verification
bool require_full_verification
Definition
chainstate.h:34
node::ChainstateLoadOptions::check_level
int64_t check_level
Definition
chainstate.h:36
node::ChainstateLoadOptions::check_blocks
int64_t check_blocks
Definition
chainstate.h:35
node::ChainstateLoadOptions::coins_error_cb
std::function< void()> coins_error_cb
Definition
chainstate.h:37
node::ChainstateLoadOptions::prune
bool prune
Definition
chainstate.h:29
translation.h
DEFAULT_CHECKLEVEL
static constexpr int DEFAULT_CHECKLEVEL
Definition
validation.h:78
DEFAULT_CHECKBLOCKS
static const signed int DEFAULT_CHECKBLOCKS
Definition
validation.h:77
Generated on
for Bitcoin Core by
1.17.0