@@ -1144,22 +1144,22 @@ void CBudgetManager::Sync(CNode* pfrom, uint256 nProp, bool fPartial)
1144
1144
1145
1145
*/
1146
1146
1147
- vector<CInv> vInv ;
1147
+ int nInvCount = 0 ;
1148
1148
1149
1149
std::map<uint256, CBudgetProposalBroadcast>::iterator it1 = mapSeenMasternodeBudgetProposals.begin ();
1150
1150
while (it1 != mapSeenMasternodeBudgetProposals.end ()){
1151
1151
CBudgetProposal* pbudgetProposal = FindProposal ((*it1).first );
1152
1152
if (pbudgetProposal && pbudgetProposal->fValid && (nProp == 0 || (*it1).first == nProp)){
1153
- CInv inv (MSG_BUDGET_PROPOSAL, (*it1).second .GetHash ());
1154
- vInv. push_back (inv) ;
1153
+ pfrom-> PushInventory ( CInv (MSG_BUDGET_PROPOSAL, (*it1).second .GetHash () ));
1154
+ nInvCount++ ;
1155
1155
1156
1156
// send votes
1157
1157
std::map<uint256, CBudgetVote>::iterator it2 = pbudgetProposal->mapVotes .begin ();
1158
1158
while (it2 != pbudgetProposal->mapVotes .end ()){
1159
1159
if ((*it2).second .fValid ){
1160
1160
if ((fPartial && !(*it2).second .fSynced ) || !fPartial ) {
1161
- CInv inv (MSG_BUDGET_VOTE, (*it2).second .GetHash ());
1162
- vInv. push_back (inv) ;
1161
+ pfrom-> PushInventory ( CInv (MSG_BUDGET_VOTE, (*it2).second .GetHash () ));
1162
+ nInvCount++ ;
1163
1163
}
1164
1164
}
1165
1165
++it2;
@@ -1168,27 +1168,26 @@ void CBudgetManager::Sync(CNode* pfrom, uint256 nProp, bool fPartial)
1168
1168
++it1;
1169
1169
}
1170
1170
1171
- pfrom->PushMessage (" ssc" , MASTERNODE_SYNC_BUDGET_PROP, (int )vInv.size ());
1172
- if (vInv.size () > 0 ) pfrom->PushMessage (" inv" , vInv);
1171
+ pfrom->PushMessage (" ssc" , MASTERNODE_SYNC_BUDGET_PROP, nInvCount);
1173
1172
1174
- LogPrintf (" CBudgetManager::Sync - sent %d items\n " , ( int )vInv. size () );
1173
+ LogPrintf (" CBudgetManager::Sync - sent %d items\n " , nInvCount );
1175
1174
1176
- vInv. clear () ;
1175
+ nInvCount = 0 ;
1177
1176
1178
1177
std::map<uint256, CFinalizedBudgetBroadcast>::iterator it3 = mapSeenFinalizedBudgets.begin ();
1179
1178
while (it3 != mapSeenFinalizedBudgets.end ()){
1180
1179
CFinalizedBudget* pfinalizedBudget = FindFinalizedBudget ((*it3).first );
1181
1180
if (pfinalizedBudget && pfinalizedBudget->fValid && (nProp == 0 || (*it3).first == nProp)){
1182
- CInv inv (MSG_BUDGET_FINALIZED, (*it3).second .GetHash ());
1183
- vInv. push_back (inv) ;
1181
+ pfrom-> PushInventory ( CInv (MSG_BUDGET_FINALIZED, (*it3).second .GetHash () ));
1182
+ nInvCount++ ;
1184
1183
1185
1184
// send votes
1186
1185
std::map<uint256, CFinalizedBudgetVote>::iterator it4 = pfinalizedBudget->mapVotes .begin ();
1187
1186
while (it4 != pfinalizedBudget->mapVotes .end ()){
1188
1187
if ((*it4).second .fValid ) {
1189
1188
if ((fPartial && !(*it4).second .fSynced ) || !fPartial ) {
1190
- CInv inv (MSG_BUDGET_FINALIZED_VOTE, (*it4).second .GetHash ());
1191
- vInv. push_back (inv) ;
1189
+ pfrom-> PushInventory ( CInv (MSG_BUDGET_FINALIZED_VOTE, (*it4).second .GetHash () ));
1190
+ nInvCount++ ;
1192
1191
}
1193
1192
}
1194
1193
++it4;
@@ -1197,9 +1196,8 @@ void CBudgetManager::Sync(CNode* pfrom, uint256 nProp, bool fPartial)
1197
1196
++it3;
1198
1197
}
1199
1198
1200
- pfrom->PushMessage (" ssc" , MASTERNODE_SYNC_BUDGET_FIN, (int )vInv.size ());
1201
- if (vInv.size () > 0 ) pfrom->PushMessage (" inv" , vInv);
1202
- LogPrintf (" CBudgetManager::Sync - sent %d items\n " , (int )vInv.size ());
1199
+ pfrom->PushMessage (" ssc" , MASTERNODE_SYNC_BUDGET_FIN, nInvCount);
1200
+ LogPrintf (" CBudgetManager::Sync - sent %d items\n " , nInvCount);
1203
1201
1204
1202
}
1205
1203
0 commit comments