Help human fix

This commit is contained in:
jl777
2018-09-24 05:45:38 -11:00
parent 12832b1d22
commit 63cadcf444

View File

@@ -3619,7 +3619,17 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
// our genesis block. In practice this (probably) won't happen because of checks elsewhere.
auto reorgLength = pindexOldTip ? pindexOldTip->nHeight - (pindexFork ? pindexFork->nHeight : -1) : 0;
static_assert(MAX_REORG_LENGTH > 0, "We must be able to reorg some distance");
if (reorgLength > MAX_REORG_LENGTH) {
if (reorgLength > MAX_REORG_LENGTH)
{
int32_t notarizedht,prevMoMheight; uint256 notarizedhash,txid;
notarizedht = komodo_notarized_height(&prevMoMheight,&notarizedhash,&txid);
if ( pindexFork->nHeight < notarizedht )
{
fprintf(stderr,"pindexFork->nHeight.%d is < notarizedht %d, so ignore it\n",(int32_t)pindexFork->nHeight,notarizedht);
pindexFork = pindexOldTip;
}
else
{
auto msg = strprintf(_(
"A block chain reorganization has been detected that would roll back %d blocks! "
"This is larger than the maximum of %d blocks, and so the node is shutting down for your safety."
@@ -3637,6 +3647,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
StartShutdown();
return false;
}
}
// Disconnect active blocks which are no longer in the best chain.
bool fBlocksDisconnected = false;