Add context check in connectTip

This commit is contained in:
jl777
2019-01-08 23:19:28 -11:00
parent ce5995738b
commit 8e172149f6

View File

@@ -3170,6 +3170,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
//fprintf(stderr,"checkblock failure in connectblock futureblock.%d\n",futureblock);
return false;
}
if ( fCheckPOW != 0 && pindex->nTime > 1548979200 && !ContextualCheckBlock(block, state, pindex->pprev) ) // activate check Feb 1, 2019
{
fprintf(stderr,"ContextualCheckBlock failed ht.%d\n",(int32_t)pindex->GetHeight());
return false;
}
// verify that the view's current state corresponds to the previous block
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();