Fix IsInitialBlockDownload which was broken by headers first.

This commit is contained in:
Ruben Dario Ponticelli 2014-10-28 14:48:50 -03:00
parent 723c752636
commit a2d0fc658a
No known key found for this signature in database
GPG key ID: 007D7A89C6DF7B2D

View file

@ -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;