Add contextual check in connect block from connecttip
This commit is contained in:
@@ -3180,7 +3180,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||||||
//fprintf(stderr,"checkblock failure in connectblock futureblock.%d\n",futureblock);
|
//fprintf(stderr,"checkblock failure in connectblock futureblock.%d\n",futureblock);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if ( fCheckPOW != 0 && pindex->nTime > 1546028567 && !ContextualCheckBlock(block, state, pindex->pprev) )
|
||||||
|
{
|
||||||
|
fprintf(stderr,"ContextualCheckBlock failed ht.%d\n",(int32_t)pindex->nHeight);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// verify that the view's current state corresponds to the previous block
|
// verify that the view's current state corresponds to the previous block
|
||||||
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
|
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
|
||||||
if ( hashPrevBlock != view.GetBestBlock() )
|
if ( hashPrevBlock != view.GetBestBlock() )
|
||||||
|
|||||||
Reference in New Issue
Block a user