From 04d82025d8da464f5933c4bf7012c025180e7e13 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 27 Sep 2016 11:52:13 +0300 Subject: [PATCH] backport 8aa722609d7e736b3a3763e15b552795b94f0e9b (IBD fix) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 8ebef4cc3..f03cd829e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1817,7 +1817,7 @@ bool IsInitialBlockDownload() if (fCheckpointsEnabled && chainActive.Height() < Checkpoints::GetTotalBlocksEstimate(chainParams.Checkpoints())) return true; bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 || - pindexBestHeader->GetBlockTime() < GetTime() - chainParams.MaxTipAge()); + std::max(chainActive.Tip()->GetBlockTime(), pindexBestHeader->GetBlockTime()) < GetTime() - chainParams.MaxTipAge()); if (!state) lockIBDState = true; return state;