From 7815f6e32ef7154043b482df63eeffc907b356ea Mon Sep 17 00:00:00 2001 From: TheLazieR Yip Date: Sun, 1 Jan 2017 17:18:05 +0700 Subject: [PATCH] Provide correct warning in CheckForkWarningConditions for large worked invalid chain. (#1234) --- src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b36c5d48e..1ba421160 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1857,7 +1857,10 @@ void CheckForkWarningConditions() } else { - LogPrintf("%s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\nChain state database corruption likely.\n", __func__); + if(pindexBestInvalid->nHeight > chainActive.Height() + 6) + LogPrintf("%s: Warning: Found invalid chain at least ~6 blocks longer than our best chain.\nChain state database corruption likely.\n", __func__); + else + 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__); fLargeWorkInvalidChainFound = true; } }