Bitcoin Core 28.99.0
P2P Digital Currency
Public Member Functions | Public Attributes | Static Private Attributes | List of all members
CDiskBlockIndex Class Reference

Used to marshal pointers into hashes for db storage. More...

#include <chain.h>

Inheritance diagram for CDiskBlockIndex:
[legend]
Collaboration diagram for CDiskBlockIndex:
[legend]

Public Member Functions

 CDiskBlockIndex ()
 
 CDiskBlockIndex (const CBlockIndex *pindex)
 
 SERIALIZE_METHODS (CDiskBlockIndex, obj)
 
uint256 ConstructBlockHash () const
 
uint256 GetBlockHash ()=delete
 
std::string ToString ()=delete
 
- Public Member Functions inherited from CBlockIndex
int nFile GUARDED_BY (::cs_main)
 Which # file this block is stored in (blk?????.dat) More...
 
unsigned int nDataPos GUARDED_BY (::cs_main)
 Byte offset within blk?????.dat where this block's data is stored. More...
 
unsigned int nUndoPos GUARDED_BY (::cs_main)
 Byte offset within rev?????.dat where this block's undo data is stored. More...
 
uint32_t nStatus GUARDED_BY (::cs_main)
 Verification status of this block. More...
 
 CBlockIndex (const CBlockHeader &block)
 
FlatFilePos GetBlockPos () const EXCLUSIVE_LOCKS_REQUIRED(
 
FlatFilePos GetUndoPos () const EXCLUSIVE_LOCKS_REQUIRED(
 
CBlockHeader GetBlockHeader () const
 
uint256 GetBlockHash () const
 
bool HaveNumChainTxs () const
 Check whether this block and all previous blocks back to the genesis block or an assumeutxo snapshot block have reached VALID_TRANSACTIONS and had transactions downloaded (and stored to disk) at some point. More...
 
NodeSeconds Time () const
 
int64_t GetBlockTime () const
 
int64_t GetBlockTimeMax () const
 
int64_t GetMedianTimePast () const
 
std::string ToString () const
 
bool IsValid (enum BlockStatus nUpTo=BLOCK_VALID_TRANSACTIONS) const EXCLUSIVE_LOCKS_REQUIRED(
 Check whether this block index entry is valid up to the passed validity level. More...
 
bool RaiseValidity (enum BlockStatus nUpTo) EXCLUSIVE_LOCKS_REQUIRED(
 Raise the validity level of this block index entry. More...
 
void BuildSkip ()
 Build the skiplist pointer for this entry. More...
 
CBlockIndexGetAncestor (int height)
 Efficiently find an ancestor of this block. More...
 
const CBlockIndexGetAncestor (int height) const
 
 CBlockIndex ()=default
 
 ~CBlockIndex ()=default
 

Public Attributes

uint256 hashPrev
 
- Public Attributes inherited from CBlockIndex
const uint256phashBlock {nullptr}
 pointer to the hash of the block, if any. Memory is owned by this CBlockIndex More...
 
CBlockIndexpprev {nullptr}
 pointer to the index of the predecessor of this block More...
 
CBlockIndexpskip {nullptr}
 pointer to the index of some further predecessor of this block More...
 
int nHeight {0}
 height of the entry in the chain. The genesis block has height 0 More...
 
arith_uint256 nChainWork {}
 (memory only) Total amount of work (expected number of hashes) in the chain up to and including this block More...
 
unsigned int nTx {0}
 Number of transactions in this block. More...
 
uint64_t m_chain_tx_count {0}
 (memory only) Number of transactions in the chain up to and including this block. More...
 
int32_t nVersion {0}
 block header More...
 
uint256 hashMerkleRoot {}
 
uint32_t nTime {0}
 
uint32_t nBits {0}
 
uint32_t nNonce {0}
 
int32_t nSequenceId {0}
 (memory only) Sequential id assigned to distinguish order in which blocks are received. More...
 
unsigned int nTimeMax {0}
 (memory only) Maximum nTime in the chain up to and including this block. More...
 

Static Private Attributes

static constexpr int DUMMY_VERSION = 259900
 Historically CBlockLocator's version field has been written to disk streams as the client version, but the value has never been used. More...
 

Additional Inherited Members

- Static Public Attributes inherited from CBlockIndex
static constexpr int nMedianTimeSpan = 11
 
- Protected Member Functions inherited from CBlockIndex
 CBlockIndex (const CBlockIndex &)=default
 CBlockIndex should not allow public copy construction because equality comparison via pointer is very common throughout the codebase, making use of copy a footgun. More...
 
CBlockIndexoperator= (const CBlockIndex &)=delete
 
 CBlockIndex (CBlockIndex &&)=delete
 
CBlockIndexoperator= (CBlockIndex &&)=delete
 

Detailed Description

Used to marshal pointers into hashes for db storage.

Definition at line 354 of file chain.h.

Constructor & Destructor Documentation

◆ CDiskBlockIndex() [1/2]

CDiskBlockIndex::CDiskBlockIndex ( )
inline

Definition at line 367 of file chain.h.

◆ CDiskBlockIndex() [2/2]

CDiskBlockIndex::CDiskBlockIndex ( const CBlockIndex pindex)
inlineexplicit

Definition at line 372 of file chain.h.

Here is the call graph for this function:

Member Function Documentation

◆ ConstructBlockHash()

uint256 CDiskBlockIndex::ConstructBlockHash ( ) const
inline

Definition at line 399 of file chain.h.

Here is the call graph for this function:

◆ GetBlockHash()

uint256 CDiskBlockIndex::GetBlockHash ( )
delete

◆ SERIALIZE_METHODS()

CDiskBlockIndex::SERIALIZE_METHODS ( CDiskBlockIndex  ,
obj   
)
inline

Definition at line 377 of file chain.h.

◆ ToString()

std::string CDiskBlockIndex::ToString ( )
delete

Member Data Documentation

◆ DUMMY_VERSION

constexpr int CDiskBlockIndex::DUMMY_VERSION = 259900
staticconstexprprivate

Historically CBlockLocator's version field has been written to disk streams as the client version, but the value has never been used.

Hard-code to the highest client version ever written. SerParams can be used if the field requires any meaning in the future.

Definition at line 362 of file chain.h.

◆ hashPrev

uint256 CDiskBlockIndex::hashPrev

Definition at line 365 of file chain.h.


The documentation for this class was generated from the following file: