Do not switch from MASTERNODE_SYNC_SPORKS to next asset until blockchain is synced

This commit is contained in:
UdjinM6 2016-09-27 12:02:57 +03:00
parent 174ee8f880
commit cfeda84a3c

View File

@ -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
}