Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
chain.h
Go to the documentation of this file.
1// Copyright (c) 2022-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_KERNEL_CHAIN_H
6#define BITCOIN_KERNEL_CHAIN_H
7
8#include <attributes.h>
9
10#include <cstdint>
11#include <iostream>
12
13class CBlock;
14class CBlockIndex;
15class CBlockUndo;
16class uint256;
17
18namespace interfaces {
20struct BlockInfo {
21 const uint256& hash;
22 const uint256* prev_hash = nullptr;
23 int height = -1;
24 int file_number = -1;
25 uint64_t data_pos = 0;
26 const CBlock* data = nullptr;
27 const CBlockUndo* undo_data = nullptr;
28 // The maximum time in the chain up to and including this block.
29 // A timestamp that can only move forward.
30 unsigned int chain_time_max{0};
31
33};
34} // namespace interfaces
35
36namespace kernel {
37struct ChainstateRole;
39interfaces::BlockInfo MakeBlockInfo(const CBlockIndex* block_index, const CBlock* data = nullptr);
40std::ostream& operator<<(std::ostream& os, const ChainstateRole& role);
41} // namespace kernel
42
43#endif // BITCOIN_KERNEL_CHAIN_H
#define LIFETIMEBOUND
Definition attributes.h:16
Definition block.h:74
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition chain.h:94
Undo information for a CBlock.
Definition undo.h:64
256-bit opaque blob.
Definition uint256.h:196
interfaces::BlockInfo MakeBlockInfo(const CBlockIndex *index, const CBlock *data)
Return data from block index.
Definition chain.cpp:18
std::ostream & operator<<(std::ostream &os, const ChainstateRole &role)
Definition chain.cpp:33
const uint256 * prev_hash
Definition chain.h:22
const CBlock * data
Definition chain.h:26
const uint256 & hash
Definition chain.h:21
BlockInfo(const uint256 &hash LIFETIMEBOUND)
Definition chain.h:32
const CBlockUndo * undo_data
Definition chain.h:27
uint64_t data_pos
Definition chain.h:25
unsigned int chain_time_max
Definition chain.h:30
Information about chainstate that notifications are sent from.
Definition types.h:18