Bitcoin Core  27.99.0
P2P Digital Currency
chain.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_CHAIN_H
6 #define BITCOIN_KERNEL_CHAIN_H
7 
8 #include<iostream>
9 
10 class CBlock;
11 class CBlockIndex;
12 namespace interfaces {
13 struct BlockInfo;
14 } // namespace interfaces
15 
16 namespace kernel {
18 interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* block_index, const CBlock* data = nullptr);
19 
20 } // namespace kernel
21 
25 enum class ChainstateRole {
26  // Single chainstate in use, "normal" IBD mode.
27  NORMAL,
28 
29  // Doing IBD-style validation in the background. Implies use of an assumed-valid
30  // chainstate.
31  BACKGROUND,
32 
33  // Active assumed-valid chainstate. Implies use of a background IBD chainstate.
35 };
36 
37 std::ostream& operator<<(std::ostream& os, const ChainstateRole& role);
38 
39 #endif // BITCOIN_KERNEL_CHAIN_H
Definition: block.h:69
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:141
ChainstateRole
This enum describes the various roles a specific Chainstate instance can take.
Definition: chain.h:25
std::ostream & operator<<(std::ostream &os, const ChainstateRole &role)
Definition: chain.cpp:30
interfaces::BlockInfo MakeBlockInfo(const CBlockIndex *index, const CBlock *data)
Return data from block index.
Definition: chain.cpp:14
Block data sent with blockConnected, blockDisconnected notifications.
Definition: chain.h:84