GetNextWorkRequired

Compute the proof-of-work target (nBits) required for the block following pindexLast.

Synopsis

Declared in <pow.h>

unsigned int
GetNextWorkRequired(
    CBlockIndex const* pindexLast,
    CBlockHeader const* pblock,
    Consensus::Params const& params);

Return Value

The required target in compact nBits form.

Parameters

NameDescription
pindexLastThe last block before the one whose target is being computed.
pblockThe candidate block header being connected.
paramsThe consensus parameters for the active chain.