aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorRuben Dario Ponticelli <rdponticelli@gmail.com>2014-10-28 14:48:50 -0300
committerRuben Dario Ponticelli <rdponticelli@gmail.com>2014-10-28 18:16:52 -0300
commita2d0fc658a7b21d2d41ef2a6c657d24114b6c49e (patch)
treedb2a32354b47ff8c8fe441222ef1bbefa2033a79 /src/main.cpp
parent723c7526368badda15df8ac1ffc047a0ab2e384a (diff)
downloadbitcoin-a2d0fc658a7b21d2d41ef2a6c657d24114b6c49e.tar.xz
Fix IsInitialBlockDownload which was broken by headers first.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 008a059103..bf487df39f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1177,15 +1177,8 @@ bool IsInitialBlockDownload()
LOCK(cs_main);
if (fImporting || fReindex || chainActive.Height() < Checkpoints::GetTotalBlocksEstimate())
return true;
- static int64_t nLastUpdate;
- static CBlockIndex* pindexLastBest;
- if (chainActive.Tip() != pindexLastBest)
- {
- pindexLastBest = chainActive.Tip();
- nLastUpdate = GetTime();
- }
- return (GetTime() - nLastUpdate < 10 &&
- chainActive.Tip()->GetBlockTime() < GetTime() - 24 * 60 * 60);
+ return (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
+ pindexBestHeader->GetBlockTime() < GetTime() - 24 * 60 * 60);
}
bool fLargeWorkForkFound = false;