From bca01f86eb28b41b60b12229a625891b7fc50fc2 Mon Sep 17 00:00:00 2001 From: miketout Date: Sat, 25 Aug 2018 21:47:10 -0700 Subject: [PATCH] Ensure in sync differently --- src/main.cpp | 2 +- src/miner.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 84a05bdbd..3ce84688e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1956,7 +1956,7 @@ bool IsInSync() pbi = chainActive.Tip(); if ( !pbi ) return false; - else if ( pindexBestHeader != 0 && ((pindexBestHeader->nHeight - 1) > pbi->nHeight) ) + else if ( pindexBestHeader == 0 || ((komodo_longestchain() - 1) > pbi->nHeight) ) return false; return true; diff --git a/src/miner.cpp b/src/miner.cpp index 2c14d28d8..79d6b70db 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -804,7 +804,7 @@ int32_t waitForPeers(const CChainParams &chainparams) LOCK(cs_vNodes); fvNodesEmpty = vNodes.empty(); } - } while (!IsInSync() || fvNodesEmpty); + } while (fvNodesEmpty || !IsInSync()); MilliSleep(100 + rand() % 400); } }