From c4ee2c89ef3be28388211cd661f0bd04e691e3d4 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 4 Aug 2018 16:39:15 +0300 Subject: [PATCH] Fix mnsync in regtest (#2202) --- src/masternode-sync.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index d78bc11f25..7b421cb6c1 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -184,22 +184,21 @@ void CMasternodeSync::ProcessTick(CConnman& connman) // QUICK MODE (REGTEST ONLY!) if(Params().NetworkIDString() == CBaseChainParams::REGTEST) { - if(nRequestedMasternodeAttempt <= 2) { + if (nRequestedMasternodeAssets == MASTERNODE_SYNC_WAITING) { connman.PushMessage(pnode, msgMaker.Make(NetMsgType::GETSPORKS)); //get current network sporks - } else if(nRequestedMasternodeAttempt < 4) { + } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_LIST) { mnodeman.DsegUpdate(pnode, connman); - } else if(nRequestedMasternodeAttempt < 6) { + } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_MNW) { //sync payment votes if(pnode->nVersion == 70208) { connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC, mnpayments.GetStorageLimit())); //sync payment votes } else { connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC)); //sync payment votes } + } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_GOVERNANCE) { SendGovernanceSyncRequest(pnode, connman); - } else { - nRequestedMasternodeAssets = MASTERNODE_SYNC_FINISHED; } - nRequestedMasternodeAttempt++; + SwitchToNextAsset(connman); connman.ReleaseNodeVector(vNodesCopy); return; }