Deprecate nMnCount in mnget (#1942)

This commit is contained in:
UdjinM6 2018-02-21 19:32:21 +03:00 committed by GitHub
parent 5b1c4d8a11
commit 43671a39df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 6 deletions

View File

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

View File

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

View File

@ -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);