Ensure in sync differently

This commit is contained in:
miketout
2018-08-25 21:47:10 -07:00
parent 6d84700d44
commit bca01f86eb
2 changed files with 2 additions and 2 deletions

View File

@@ -1956,7 +1956,7 @@ bool IsInSync()
pbi = chainActive.Tip(); pbi = chainActive.Tip();
if ( !pbi ) if ( !pbi )
return false; return false;
else if ( pindexBestHeader != 0 && ((pindexBestHeader->nHeight - 1) > pbi->nHeight) ) else if ( pindexBestHeader == 0 || ((komodo_longestchain() - 1) > pbi->nHeight) )
return false; return false;
return true; return true;

View File

@@ -804,7 +804,7 @@ int32_t waitForPeers(const CChainParams &chainparams)
LOCK(cs_vNodes); LOCK(cs_vNodes);
fvNodesEmpty = vNodes.empty(); fvNodesEmpty = vNodes.empty();
} }
} while (!IsInSync() || fvNodesEmpty); } while (fvNodesEmpty || !IsInSync());
MilliSleep(100 + rand() % 400); MilliSleep(100 + rand() % 400);
} }
} }