Earlier check of the nNonce in block header.

This commit is contained in:
kevacoin 2021-12-26 15:33:31 -08:00
parent 1fff338509
commit 1d031c421a

View File

@ -3202,6 +3202,10 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationSta
assert(pindexPrev != nullptr);
const int nHeight = pindexPrev->nHeight + 1;
// Kevacoin: the nNonce should be the current height.
if ((int32_t)block.nNonce != nHeight)
return state.Invalid(false, REJECT_INVALID, "nonce-not-height", "nNonce not equal height");
// Check proof of work
const Consensus::Params& consensusParams = params.GetConsensus();
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))