node::BlockManager::AddToBlockIndex

Add a block header to the in-memory block index, updating the best header.

Synopsis

Declared in <node/blockstorage.h>

[[requires_capability(0x7f2e1b098fc8), requires_capability(0x7f2e26d1a728), requires_capability(0x7f2e375e0808), requires_capability(0x7f2e33367bc8), requires_capability(0x7f2e3542ebb8), requires_capability(0x7f2e28a73718)]]
CBlockIndex*
AddToBlockIndex(
    CBlockHeader const& block,
    CBlockIndex*& best_header);

Return Value

The block index entry for block.

Parameters

NameDescription
blockThe block header to add.
best_headerReference to the best-header pointer, updated if this block is better.