node::SubmitBlock

Submit a block and capture the validation state via the BlockChecked callback. Returns whether the block was accepted as a new valid block.

Synopsis

Declared in <node/miner.h>

bool
SubmitBlock(
    ChainstateManager& chainman,
    std::shared_ptr<CBlock const> const& block,
    std::string& reason,
    std::string& debug);

Return Value

True if the block was accepted as a new valid block.

Parameters

NameDescription
chainmanThe chainstate manager to submit the block to.
blockThe block to submit.
reasonOutput set to a short rejection reason on failure.
debugOutput set to a detailed rejection message on failure.