aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-11-24 15:28:57 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-11-24 15:29:52 +0100
commit1ee685f984bdeaac7468019c6e2cd4b7d3496aef (patch)
treed45af927151ce00ee0fc4f93eefa33ebb474b2e0 /src/main.cpp
parentc5a22828559bdac8fd347e30a3027dbaf54934ae (diff)
parent730b1ed1a0d2b2b0f278ee808e7e266a50fac94b (diff)
Merge pull request #5154
730b1ed Check pindexBestForkBase for null (21E14)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 02062c3935..88cb9c5b26 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1228,13 +1228,13 @@ void CheckForkWarningConditions()
if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (GetBlockProof(*chainActive.Tip()) * 6)))
{
- if (!fLargeWorkForkFound)
+ if (!fLargeWorkForkFound && pindexBestForkBase)
{
std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") +
pindexBestForkBase->phashBlock->ToString() + std::string("'");
CAlert::Notify(warning, true);
}
- if (pindexBestForkTip)
+ if (pindexBestForkTip && pindexBestForkBase)
{
LogPrintf("CheckForkWarningConditions: Warning: Large valid fork found\n forking the chain at height %d (%s)\n lasting to height %d (%s).\nChain state database corruption likely.\n",
pindexBestForkBase->nHeight, pindexBestForkBase->phashBlock->ToString(),