[#Chainstate-ActivateBestChainStep] = xref:Chainstate.adoc[Chainstate]::ActivateBestChainStep :relfileprefix: ../ :mrdocs: Connect a run of blocks toward the most‐work chain, one step of ActivateBestChain. == Synopsis Declared in `<validation.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[requires_capability(0x7ff37b903138, 0x7ff37b9031b0), requires_capability(0x7ff375c49d48, 0x7ff375c49dc0), requires_capability(0x7ff37e054bb8, 0x7ff37e054c30), requires_capability(0x7ff375935b18, 0x7ff375935b90)]] bool ActivateBestChainStep( xref:BlockValidationState.adoc[BlockValidationState]& state, xref:CBlockIndex.adoc[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 [cols="1,4"] |=== | Name| Description | *state* | Validation state updated with the reason for any failure. | *index_most_work* | Block index entry of the most‐work candidate to build toward. | *pblock* | Optional already‐loaded block to avoid re‐reading it from disk. | *fInvalidFound* | Set to true if an invalid block was found during the step. | *connected_blocks* | Collects the blocks connected during this step. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#