Chainstate::ActivateBestChainStep

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

Synopsis

Declared in <validation.h>

[[requires_capability(0x7fbc8fb67158, 0x7fbc8fb671d0), requires_capability(0x7fbc96bff7c8, 0x7fbc96bff840), requires_capability(0x7fbcaf5d6bd8, 0x7fbcaf5d6c50), requires_capability(0x7fbc9e0dd3a8, 0x7fbc9e0dd420)]]
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.