mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-12 16:17:53 +00:00
Earlier check of the nNonce in block header.
This commit is contained in:
parent
1fff338509
commit
1d031c421a
@ -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…
Reference in New Issue
Block a user