|
|
@ -3509,8 +3509,8 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl |
|
|
|
// return state.DoS(100, error("CheckBlockHeader(): block version too low"),REJECT_INVALID, "version-too-low");
|
|
|
|
|
|
|
|
// Check Equihash solution is valid
|
|
|
|
if ( fCheckPOW && !CheckEquihashSolution(&blockhdr, Params()) ) |
|
|
|
return state.DoS(100, error("CheckBlockHeader(): Equihash solution invalid"),REJECT_INVALID, "invalid-solution"); |
|
|
|
/*if ( fCheckPOW && !CheckEquihashSolution(&blockhdr, Params()) )
|
|
|
|
return state.DoS(100, error("CheckBlockHeader(): Equihash solution invalid"),REJECT_INVALID, "invalid-solution");*/ |
|
|
|
|
|
|
|
// Check proof of work matches claimed amount
|
|
|
|
/*komodo_index2pubkey33(pubkey33,pindex,height);
|
|
|
@ -3565,11 +3565,12 @@ bool CheckBlock(int32_t height,CBlockIndex *pindex,const CBlock& block, CValidat |
|
|
|
// redundant with the call in AcceptBlockHeader.
|
|
|
|
if (!CheckBlockHeader(height,pindex,block,state,fCheckPOW)) |
|
|
|
return false; |
|
|
|
//komodo_index2pubkey33(pubkey33,pindex,height);
|
|
|
|
if ( fCheckPOW && !CheckEquihashSolution(&blockhdr, Params()) ) |
|
|
|
return state.DoS(100, error("CheckBlock(): Equihash solution invalid"),REJECT_INVALID, "invalid-solution"); |
|
|
|
komodo_block2pubkey33(pubkey33,(CBlock *)&block); |
|
|
|
if ( fCheckPOW && !CheckProofOfWork(height,pubkey33,block.GetHash(), block.nBits, Params().GetConsensus()) ) |
|
|
|
{ |
|
|
|
komodo_reverify_blockcheck(state,height,pindex); |
|
|
|
//komodo_reverify_blockcheck(state,height,pindex);
|
|
|
|
return state.DoS(1, error("CheckBlock(): proof of work failed"),REJECT_INVALID, "high-hash"); |
|
|
|
} |
|
|
|
// Check the merkle root.
|
|
|
|