Skip to content

Commit 1ee685f

Browse files
committed
Merge pull request #5154
730b1ed Check pindexBestForkBase for null (21E14)
2 parents c5a2282 + 730b1ed commit 1ee685f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,13 +1228,13 @@ void CheckForkWarningConditions()
12281228

12291229
if (pindexBestForkTip || (pindexBestInvalid && pindexBestInvalid->nChainWork > chainActive.Tip()->nChainWork + (GetBlockProof(*chainActive.Tip()) * 6)))
12301230
{
1231-
if (!fLargeWorkForkFound)
1231+
if (!fLargeWorkForkFound && pindexBestForkBase)
12321232
{
12331233
std::string warning = std::string("'Warning: Large-work fork detected, forking after block ") +
12341234
pindexBestForkBase->phashBlock->ToString() + std::string("'");
12351235
CAlert::Notify(warning, true);
12361236
}
1237-
if (pindexBestForkTip)
1237+
if (pindexBestForkTip && pindexBestForkBase)
12381238
{
12391239
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",
12401240
pindexBestForkBase->nHeight, pindexBestForkBase->phashBlock->ToString(),

0 commit comments

Comments
 (0)