Skip to content

Commit 7815f6e

Browse files
thelazierUdjinM6
authored andcommitted
Provide correct warning in CheckForkWarningConditions for large worked invalid chain. (dashpay#1234)
1 parent 275b95c commit 7815f6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1857,7 +1857,10 @@ void CheckForkWarningConditions()
18571857
}
18581858
else
18591859
{
1860-
LogPrintf("%s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\nChain state database corruption likely.\n", __func__);
1860+
if(pindexBestInvalid->nHeight > chainActive.Height() + 6)
1861+
LogPrintf("%s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\nChain state database corruption likely.\n", __func__);
1862+
else
1863+
LogPrintf("%s: Warning: Found invalid chain which has higher work (at least ~6 blocks worth of work) than our best chain.\nChain state database corruption likely.\n", __func__);
18611864
fLargeWorkInvalidChainFound = true;
18621865
}
18631866
}

0 commit comments

Comments
 (0)