diff --git a/dash-docs/protocol-documentation.md b/dash-docs/protocol-documentation.md index a7da4c437..6d895a3c1 100644 --- a/dash-docs/protocol-documentation.md +++ b/dash-docs/protocol-documentation.md @@ -349,5 +349,6 @@ Masternode Payment Sync | Field Size | Field Name | Data type | Description | | ---------- | ----------- | --------- | ---------- | -| 4 | nMnCount | int | | +| 4 | nMnCount | int | | (DEPRECATED) +*NOTE: There are no fields in this mesasge starting from protocol 70209* diff --git a/src/masternode-payments.cpp b/src/masternode-payments.cpp index 9b94ee3fe..d4a6887d4 100644 --- a/src/masternode-payments.cpp +++ b/src/masternode-payments.cpp @@ -295,8 +295,11 @@ void CMasternodePayments::ProcessMessage(CNode* pfrom, const std::string& strCom // but this is a heavy one so it's better to finish sync first. if (!masternodeSync.IsSynced()) return; - int nCountNeeded; - vRecv >> nCountNeeded; + // DEPRECATED, should be removed on next protocol bump + if(pfrom->nVersion == 70208) { + int nCountNeeded; + vRecv >> nCountNeeded; + } if(netfulfilledman.HasFulfilledRequest(pfrom->addr, NetMsgType::MASTERNODEPAYMENTSYNC)) { // Asking for the payments list multiple times in a short period of time is no good diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 4c0da7195..d9b6c9982 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -202,8 +202,12 @@ void CMasternodeSync::ProcessTick(CConnman& connman) } else if(nRequestedMasternodeAttempt < 4) { mnodeman.DsegUpdate(pnode, connman); } else if(nRequestedMasternodeAttempt < 6) { - int nMnCount = mnodeman.CountMasternodes(); - connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC, nMnCount)); //sync payment votes + //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 + } SendGovernanceSyncRequest(pnode, connman); } else { nRequestedMasternodeAssets = MASTERNODE_SYNC_FINISHED; @@ -320,7 +324,12 @@ void CMasternodeSync::ProcessTick(CConnman& connman) nRequestedMasternodeAttempt++; // ask node for all payment votes it has (new nodes will only return votes for future payments) - connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC, mnpayments.GetStorageLimit())); + //sync payment votes + if(pnode->nVersion == 70208) { + connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC, mnpayments.GetStorageLimit())); + } else { + connman.PushMessage(pnode, msgMaker.Make(NetMsgType::MASTERNODEPAYMENTSYNC)); + } // ask node for missing pieces only (old nodes will not be asked) mnpayments.RequestLowDataPaymentBlocks(pnode, connman);