mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-14 09:08:11 +00:00
Made sure major_version of Cryptonote header is correct.
This commit is contained in:
parent
d8329bd28b
commit
8314daee83
@ -3038,6 +3038,10 @@ static bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos,
|
|||||||
|
|
||||||
static bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true)
|
static bool CheckBlockHeader(const CBlockHeader& block, CValidationState& state, const Consensus::Params& consensusParams, bool fCheckPOW = true)
|
||||||
{
|
{
|
||||||
|
if (block.cnHeader.major_version != consensusParams.GetCryptonoteMajorVersion()) {
|
||||||
|
return state.Invalid(false, 0, "incorrect-major-version", "Cryptonote major version incorrect");
|
||||||
|
}
|
||||||
|
|
||||||
// Check proof of work matches claimed amount
|
// Check proof of work matches claimed amount
|
||||||
if (fCheckPOW && !CheckProofOfWork(block.GetPoWHash(), block.nBits, consensusParams))
|
if (fCheckPOW && !CheckProofOfWork(block.GetPoWHash(), block.nBits, consensusParams))
|
||||||
return state.DoS(50, false, REJECT_INVALID, "high-hash", false, "proof of work failed");
|
return state.DoS(50, false, REJECT_INVALID, "high-hash", false, "proof of work failed");
|
||||||
|
Loading…
Reference in New Issue
Block a user