Chainstate::ActivateBestChainStep

Connect a run of blocks toward the most-work chain, one step of ActivateBestChain.

Synopsis

Declared in <validation.h>

[[requires_capability(0x7f2e1ba854e8, 0x7f2e1ba85560), requires_capability(0x7f2e14565138, 0x7f2e145651b0), requires_capability(0x7f2e373be2e8, 0x7f2e373be360), requires_capability(0x7f2e36e34f38, 0x7f2e36e34fb0)]]
bool
ActivateBestChainStep(
    BlockValidationState& state,
    CBlockIndex& index_most_work,
    std::shared_ptr<CBlock const> const& pblock,
    bool& fInvalidFound,
    std::vector<ConnectedBlock>& connected_blocks);

Return Value

true unless a system error occurred.

Parameters

NameDescription
stateValidation state updated with the reason for any failure.
index_most_workBlock index entry of the most-work candidate to build toward.
pblockOptional already-loaded block to avoid re-reading it from disk.
fInvalidFoundSet to true if an invalid block was found during the step.
connected_blocksCollects the blocks connected during this step.