aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmacwhyte <keatonatron@gmail.com>2016-02-11 18:02:46 -0800
committerjmacwhyte <keatonatron@gmail.com>2016-02-11 18:02:46 -0800
commit8aa722609d7e736b3a3763e15b552795b94f0e9b (patch)
treebe77c96a8a4856030104e83498ecd7ace7cf3d4d
parent2f3f4af4cc2b92b8758858d0a1c13635065eb379 (diff)
downloadbitcoin-8aa722609d7e736b3a3763e15b552795b94f0e9b.tar.xz
Fix IsInitialBlockDownload to play nice with testnet
-rw-r--r--src/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 3ad2979b6b..9e478b6823 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1384,7 +1384,7 @@ bool IsInitialBlockDownload()
if (lockIBDState)
return false;
bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
- pindexBestHeader->GetBlockTime() < GetTime() - nMaxTipAge);
+ std::max(chainActive.Tip()->GetBlockTime(), pindexBestHeader->GetBlockTime()) < GetTime() - nMaxTipAge);
if (!state)
lockIBDState = true;
return state;