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