Skip to content

Commit a2d0fc6

Browse files
committed
Fix IsInitialBlockDownload which was broken by headers first.
1 parent 723c752 commit a2d0fc6

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/main.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,15 +1177,8 @@ bool IsInitialBlockDownload()
11771177
LOCK(cs_main);
11781178
if (fImporting || fReindex || chainActive.Height() < Checkpoints::GetTotalBlocksEstimate())
11791179
return true;
1180-
static int64_t nLastUpdate;
1181-
static CBlockIndex* pindexLastBest;
1182-
if (chainActive.Tip() != pindexLastBest)
1183-
{
1184-
pindexLastBest = chainActive.Tip();
1185-
nLastUpdate = GetTime();
1186-
}
1187-
return (GetTime() - nLastUpdate < 10 &&
1188-
chainActive.Tip()->GetBlockTime() < GetTime() - 24 * 60 * 60);
1180+
return (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
1181+
pindexBestHeader->GetBlockTime() < GetTime() - 24 * 60 * 60);
11891182
}
11901183

11911184
bool fLargeWorkForkFound = false;

0 commit comments

Comments
 (0)