More work on initial sync
This commit is contained in:
@@ -1941,7 +1941,7 @@ bool IsInSync()
|
|||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
if (fImporting || fReindex)
|
if (fImporting || fReindex)
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"IsInitialBlockDownload: fImporting %d || %d fReindex\n",(int32_t)fImporting,(int32_t)fReindex);
|
//fprintf(stderr,"IsInSync: fImporting %d || %d fReindex\n",(int32_t)fImporting,(int32_t)fReindex);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (fCheckpointsEnabled)
|
if (fCheckpointsEnabled)
|
||||||
@@ -1949,14 +1949,14 @@ bool IsInSync()
|
|||||||
pbi = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints());
|
pbi = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints());
|
||||||
if (fCheckpointsEnabled && pbi && (chainActive.Height() < pbi->nHeight))
|
if (fCheckpointsEnabled && pbi && (chainActive.Height() < pbi->nHeight))
|
||||||
{
|
{
|
||||||
//fprintf(stderr,"IsInitialBlockDownload: checkpoint -> initialdownload\n");
|
//fprintf(stderr,"IsInSync: checkpoint -> initialdownload\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pbi = chainActive.Tip();
|
pbi = chainActive.Tip();
|
||||||
if ( !pbi )
|
if ( !pbi )
|
||||||
return false;
|
return false;
|
||||||
else if ( pindexBestHeader == 0 || ((komodo_longestchain() - 1) > pbi->nHeight) )
|
else if ( pindexBestHeader == 0 || ((pindexBestHeader->nHeight - 1) > pbi->nHeight) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -799,7 +799,7 @@ int32_t waitForPeers(const CChainParams &chainparams)
|
|||||||
if (fvNodesEmpty || !IsInSync())
|
if (fvNodesEmpty || !IsInSync())
|
||||||
{
|
{
|
||||||
do {
|
do {
|
||||||
MilliSleep(100 + rand() % 400);
|
MilliSleep(1000 + rand() % 4000);
|
||||||
{
|
{
|
||||||
LOCK(cs_vNodes);
|
LOCK(cs_vNodes);
|
||||||
fvNodesEmpty = vNodes.empty();
|
fvNodesEmpty = vNodes.empty();
|
||||||
|
|||||||
Reference in New Issue
Block a user