Fix sync in regtest (again) (#2241)

Should only call SwitchToNextAsset() while being in specific state and not on every tick
This commit is contained in:
UdjinM6 2018-08-29 13:02:54 +03:00 committed by GitHub
parent 28ba2ad0fb
commit 40eee1775f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,8 +186,10 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
{ {
if (nRequestedMasternodeAssets == MASTERNODE_SYNC_WAITING) { if (nRequestedMasternodeAssets == MASTERNODE_SYNC_WAITING) {
connman.PushMessage(pnode, msgMaker.Make(NetMsgType::GETSPORKS)); //get current network sporks connman.PushMessage(pnode, msgMaker.Make(NetMsgType::GETSPORKS)); //get current network sporks
SwitchToNextAsset(connman);
} else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_LIST) { } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_LIST) {
mnodeman.DsegUpdate(pnode, connman); mnodeman.DsegUpdate(pnode, connman);
SwitchToNextAsset(connman);
} else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_MNW) { } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_MNW) {
//sync payment votes //sync payment votes
if(pnode->nVersion == 70208) { if(pnode->nVersion == 70208) {
@ -195,10 +197,11 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
} else { } else {
connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC)); //sync payment votes connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC)); //sync payment votes
} }
SwitchToNextAsset(connman);
} else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_GOVERNANCE) { } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_GOVERNANCE) {
SendGovernanceSyncRequest(pnode, connman); SendGovernanceSyncRequest(pnode, connman);
SwitchToNextAsset(connman);
} }
SwitchToNextAsset(connman);
connman.ReleaseNodeVector(vNodesCopy); connman.ReleaseNodeVector(vNodesCopy);
return; return;
} }