Skip to content

Commit

Permalink
suck it up princess, ltc devs know better than you
Browse files Browse the repository at this point in the history
  • Loading branch information
mooncoindev committed Apr 4, 2017
1 parent 4aa4d87 commit 5932d55
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1414,15 +1414,22 @@ bool IsInitialBlockDownload()
{
const CChainParams& chainParams = Params();
LOCK(cs_main);
if (fImporting || fReindex || chainActive.Height() < Checkpoints::GetTotalBlocksEstimate())
if (fImporting || fReindex || chainActive.Height() < Checkpoints::GetTotalBlocksEstimate()){
//LogPrintf("IsInitialBlockDownload = true\n"); // debug
return true;
}
static bool lockIBDState = false;
if (lockIBDState)
if (lockIBDState){
//LogPrintf("IsInitialBlockDownload = false\n"); // debug
return false;
}
bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
pindexBestHeader->GetBlockTime() < GetTime() - 24 * 60 * 60);
if (!state)
pindexBestHeader->GetBlockTime() < GetTime() - chainParams.MaxTipAge()); // this is valid once chainParams set properly
if (!state){
lockIBDState = true;
//LogPrintf("IsInitialBlockDownload (lockIBDState = true)\n"); // debug
}
//LogPrintf("IsInitialBlockDownload state %d\n", state); // debug
return state;
}

Expand Down

0 comments on commit 5932d55

Please sign in to comment.