TestBlockValidity

Verify a block, including transactions.

Synopsis

Declared in <validation.h>

[[requires_capability(0x7f2e1b930980), requires_capability(0x7f2e275a9b60), requires_capability(0x7f2e3696af60), requires_capability(0x7f2e354571b0)]]
BlockValidationState
TestBlockValidity(
    Chainstate& chainstate,
    CBlock const& block,
    bool check_pow,
    bool check_merkle_root);

Description

For signets the challenge verification is skipped when check_pow is false.

Return Value

Valid or Invalid state. This doesn't currently return an Error state, and shouldn't unless there is something wrong with the existing chainstate. (This is different from functions like AcceptBlock which can fail trying to save new data.)

Parameters

NameDescription
block [in]The block we want to process. Must connect to the current tip.
chainstate [in]The chainstate to connect to.
check_pow [in]perform proof-of-work check, nBits in the header is always checked
check_merkle_root [in]check the merkle root