diff options
author | 21E14 <21xe14@gmail.com> | 2014-10-27 23:00:55 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-02-18 18:31:41 +0100 |
commit | 74f29c27372cb88e7f4a6f14ee40b699e3c58eb0 (patch) | |
tree | c31c54ec9cc52acef716348e4b17d77c11a88d52 | |
parent | 6b4163b972e58e2a145342b973ed02bb78fc04b9 (diff) |
Check pindexBestForkBase for null
Rebased-From: 730b1ed1a0d2b2b0f278ee808e7e266a50fac94b
Github-Pull: #5154
-rw-r--r-- | src/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 6430ca04fd..a42bb8a6b0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1367,13 +1367,13 @@ void CheckForkWarningConditions() if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (chainActive.Tip()->GetBlockWork() * 6).getuint256())) { - 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(), |