Chainstate::ConnectBlock

Apply the effects of a block to a given coins view, checking its validity.

Synopsis

Declared in <validation.h>

[[requires_capability(0x7f2e1ba844e8), requires_capability(0x7f2e14564138), requires_capability(0x7f2e373bd2e8), requires_capability(0x7f2e36e33f38)]]
bool
ConnectBlock(
    CBlock const& block,
    BlockValidationState& state,
    CBlockIndex* pindex,
    CCoinsViewCache& view,
    bool fJustCheck = false);

Return Value

true if the block was connected successfully.

Parameters

NameDescription
blockThe block to connect.
stateValidation state updated with the reason for any failure.
pindexBlock index entry corresponding to the block.
viewThe coins view to apply the block to.
fJustCheckWhen true, validate the block without committing the changes.