Fix mnsync in regtest (#2202)

This commit is contained in:
UdjinM6 2018-08-04 16:39:15 +03:00 committed by GitHub
parent d4d11476aa
commit c4ee2c89ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -184,22 +184,21 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
// QUICK MODE (REGTEST ONLY!) // QUICK MODE (REGTEST ONLY!)
if(Params().NetworkIDString() == CBaseChainParams::REGTEST) if(Params().NetworkIDString() == CBaseChainParams::REGTEST)
{ {
if(nRequestedMasternodeAttempt <= 2) { 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
} else if(nRequestedMasternodeAttempt < 4) { } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_LIST) {
mnodeman.DsegUpdate(pnode, connman); mnodeman.DsegUpdate(pnode, connman);
} else if(nRequestedMasternodeAttempt < 6) { } else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_MNW) {
//sync payment votes //sync payment votes
if(pnode->nVersion == 70208) { if(pnode->nVersion == 70208) {
connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC, mnpayments.GetStorageLimit())); //sync payment votes connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC, mnpayments.GetStorageLimit())); //sync payment votes
} else { } else {
connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC)); //sync payment votes connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC)); //sync payment votes
} }
} else if (nRequestedMasternodeAssets == MASTERNODE_SYNC_GOVERNANCE) {
SendGovernanceSyncRequest(pnode, connman); SendGovernanceSyncRequest(pnode, connman);
} else {
nRequestedMasternodeAssets = MASTERNODE_SYNC_FINISHED;
} }
nRequestedMasternodeAttempt++; SwitchToNextAsset(connman);
connman.ReleaseNodeVector(vNodesCopy); connman.ReleaseNodeVector(vNodesCopy);
return; return;
} }