Accept pre-notarization block that matches

This commit is contained in:
jl777
2018-03-07 20:32:08 +02:00
parent 63998b6634
commit e2c2f297d1

View File

@@ -3372,7 +3372,14 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
if (pcheckpoint && (nHeight < pcheckpoint->nHeight || nHeight == 1 && chainActive.Tip() != 0 && chainActive.Tip()->nHeight > 1) )
return state.DoS(100, error("%s: forked chain older than last checkpoint (height %d) vs %d", __func__, nHeight,pcheckpoint->nHeight));
else if ( komodo_checkpoint(&notarized_height,nHeight,hash) < 0 )
return state.DoS(100, error("%s: forked chain %d older than last notarized (height %d) vs %d", __func__,nHeight, notarized_height));
{
CBlockIndex *heightblock = chainActive[nHeight];
if ( heightblock != 0 && pblockindex->GetBlockHash() == hash )
{
fprintf(stderr,"got a pre notarization block that matches height.%d\n",(int32_t)nHeight);
return true;
} else return state.DoS(100, error("%s: forked chain %d older than last notarized (height %d) vs %d", __func__,nHeight, notarized_height));
}
}
// Reject block.nVersion < 4 blocks
if (block.nVersion < 4)