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(0x7f95130c9018), requires_capability(0x7f950163c308), requires_capability(0x7f95241d92f8), requires_capability(0x7f951f3305f8), requires_capability(0x7f950b9c25b8), requires_capability(0x7f95175c4d08)]]
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.