HasValidProofOfWork

Check that the proof of work on each blockheader matches the value in nBits.

Synopsis

Declared in <validation.h>

bool
HasValidProofOfWork(
    std::span<CBlockHeader const> headers,
    Consensus::Params const& consensusParams);

Return Value

true if every header has valid proof of work.

Parameters

NameDescription
headersThe block headers to check.
consensusParamsConsensus parameters defining the proof-of-work rules.