This commit is contained in:
jl777
2016-10-30 18:44:41 -03:00
parent f8e367eba8
commit 8e157f5204
2 changed files with 10 additions and 1 deletions

View File

@@ -1469,16 +1469,25 @@ bool IsInitialBlockDownload()
const CChainParams& chainParams = Params();
LOCK(cs_main);
if (fImporting || fReindex)
{
fprintf(stderr,"fImporting %d || %d fReindex\n",(int32_t)fImporting,(int32_t)fReindex);
return true;
}
if (fCheckpointsEnabled && chainActive.Height() < Checkpoints::GetTotalBlocksEstimate(chainParams.Checkpoints()))
{
fprintf(stderr,"checkpoint -> initialdownload\n");
return true;
}
static bool lockIBDState = false;
if (lockIBDState)
return false;
bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
pindexBestHeader->GetBlockTime() < GetTime() - chainParams.MaxTipAge());
if (!state)
{
fprintf(stderr,"lockIBDState tru\n");
lockIBDState = true;
}
return state;
}

View File

@@ -539,7 +539,7 @@ void static BitcoinMiner(CWallet *pwallet)
if (!fvNodesEmpty && !IsInitialBlockDownload())
break;
MilliSleep(5000);
fprintf(stderr,"fvNodesEmpty %d IsInitialBlockDownload() %d\n",(int32_t)fvNodesEmpty,(int32_t)IsInitialBlockDownload());
fprintf(stderr,"fvNodesEmpty %d IsInitialBlockDownload(%s) %d\n",(int32_t)fvNodesEmpty,ASSETCHAINS_SYMBOL,(int32_t)IsInitialBlockDownload());
} while (true);
fprintf(stderr,"%s Found peers\n",ASSETCHAINS_SYMBOL);