From cfeda84a3c1cddbbaae807f47d215466ca95c628 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 27 Sep 2016 12:02:57 +0300 Subject: [PATCH] Do not switch from MASTERNODE_SYNC_SPORKS to next asset until blockchain is synced --- src/masternode-sync.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index cdaa45c6d..34b11537d 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -203,7 +203,9 @@ void CMasternodeSync::ProcessTick() TRY_LOCK(cs_vNodes, lockRecv); if(!lockRecv) return; - if(nRequestedMasternodeAssets == MASTERNODE_SYNC_INITIAL) { + if(nRequestedMasternodeAssets == MASTERNODE_SYNC_INITIAL || + (nRequestedMasternodeAssets == MASTERNODE_SYNC_SPORKS && IsBlockchainSynced())) + { SwitchToNextAsset(); } @@ -245,10 +247,6 @@ void CMasternodeSync::ProcessTick() netfulfilledman.AddFulfilledRequest(pnode->addr, "spork-sync"); // get current network sporks pnode->PushMessage(NetMsgType::GETSPORKS); - - // we always ask for sporks, so just skip this - if(nRequestedMasternodeAssets == MASTERNODE_SYNC_SPORKS) SwitchToNextAsset(); - continue; // always get sporks first, switch to the next node without waiting for the next tick }