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(0x7fbc8f17ada8), requires_capability(0x7fbca3f042d8), requires_capability(0x7fbcace16528), requires_capability(0x7fbca6c58198), requires_capability(0x7fbcad35f938), requires_capability(0x7fbc9fba16f8)]]
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.