Browse Source

Earlier check of the nNonce in block header.

main
kevacoin 3 years ago
parent
commit
1d031c421a
  1. 4
      src/validation.cpp

4
src/validation.cpp

@ -3202,6 +3202,10 @@ static bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationSta @@ -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))

Loading…
Cancel
Save