From 24dd56729b8d0a0e89febae601f4dfa157e1bad1 Mon Sep 17 00:00:00 2001 From: miketout Date: Sun, 26 Aug 2018 11:58:14 -0700 Subject: [PATCH] More work on initial sync --- src/main.cpp | 6 +++--- src/miner.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3ce84688e..8e5625ab8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1941,7 +1941,7 @@ bool IsInSync() LOCK(cs_main); 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; } if (fCheckpointsEnabled) @@ -1949,14 +1949,14 @@ bool IsInSync() pbi = Checkpoints::GetLastCheckpoint(chainParams.Checkpoints()); if (fCheckpointsEnabled && pbi && (chainActive.Height() < pbi->nHeight)) { - //fprintf(stderr,"IsInitialBlockDownload: checkpoint -> initialdownload\n"); + //fprintf(stderr,"IsInSync: checkpoint -> initialdownload\n"); return false; } } pbi = chainActive.Tip(); if ( !pbi ) return false; - else if ( pindexBestHeader == 0 || ((komodo_longestchain() - 1) > pbi->nHeight) ) + else if ( pindexBestHeader == 0 || ((pindexBestHeader->nHeight - 1) > pbi->nHeight) ) return false; return true; diff --git a/src/miner.cpp b/src/miner.cpp index 79d6b70db..85922d37f 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -799,7 +799,7 @@ int32_t waitForPeers(const CChainParams &chainparams) if (fvNodesEmpty || !IsInSync()) { do { - MilliSleep(100 + rand() % 400); + MilliSleep(1000 + rand() % 4000); { LOCK(cs_vNodes); fvNodesEmpty = vNodes.empty();