@@ -1015,7 +1015,10 @@ int CBudgetManager::ProcessProposal(CBudgetProposal& proposal)
10151015 if (!AddProposal (proposal)) {
10161016 return 0 ;
10171017 }
1018- proposal.Relay ();
1018+
1019+ // Relay only if we are synchronized
1020+ // Makes no sense to relay proposals to the peers from where we are syncing them.
1021+ if (masternodeSync.IsSynced ()) proposal.Relay ();
10191022 masternodeSync.AddedBudgetItem (nHash);
10201023
10211024 LogPrint (BCLog::MNBUDGET, " mprop (new) %s\n " , nHash.ToString ());
@@ -1058,7 +1061,9 @@ bool CBudgetManager::ProcessProposalVote(CBudgetVote& vote, CNode* pfrom, CValid
10581061 return state.DoS (0 , false , REJECT_INVALID, " bad-mvote" , false , strprintf (" %s (%s)" , err, mn_protx_id));
10591062 }
10601063
1061- vote.Relay ();
1064+ // Relay only if we are synchronized
1065+ // Makes no sense to relay votes to the peers from where we are syncing them.
1066+ if (masternodeSync.IsSynced ()) vote.Relay ();
10621067 masternodeSync.AddedBudgetItem (voteID);
10631068 LogPrint (BCLog::MNBUDGET, " mvote - new vote (%s) for proposal %s from dmn %s\n " ,
10641069 voteID.ToString (), vote.GetProposalHash ().ToString (), mn_protx_id);
@@ -1093,7 +1098,9 @@ bool CBudgetManager::ProcessProposalVote(CBudgetVote& vote, CNode* pfrom, CValid
10931098 return state.DoS (0 , false , REJECT_INVALID, " bad-mvote" , false , err);
10941099 }
10951100
1096- vote.Relay ();
1101+ // Relay only if we are synchronized
1102+ // Makes no sense to relay votes to the peers from where we are syncing them.
1103+ if (masternodeSync.IsSynced ()) vote.Relay ();
10971104 masternodeSync.AddedBudgetItem (voteID);
10981105 LogPrint (BCLog::MNBUDGET, " mvote - new vote (%s) for proposal %s from dmn %s\n " ,
10991106 voteID.ToString (), vote.GetProposalHash ().ToString (), voteVin.prevout .ToString ());
@@ -1111,7 +1118,10 @@ int CBudgetManager::ProcessFinalizedBudget(CFinalizedBudget& finalbudget, CNode*
11111118 if (!AddFinalizedBudget (finalbudget, pfrom)) {
11121119 return 0 ;
11131120 }
1114- finalbudget.Relay ();
1121+
1122+ // Relay only if we are synchronized
1123+ // Makes no sense to relay finalizations to the peers from where we are syncing them.
1124+ if (masternodeSync.IsSynced ()) finalbudget.Relay ();
11151125 masternodeSync.AddedBudgetItem (nHash);
11161126
11171127 LogPrint (BCLog::MNBUDGET, " fbs (new) %s\n " , nHash.ToString ());
@@ -1153,7 +1163,9 @@ bool CBudgetManager::ProcessFinalizedBudgetVote(CFinalizedBudgetVote& vote, CNod
11531163 return state.DoS (0 , false , REJECT_INVALID, " bad-fbvote" , false , strprintf (" %s (%s)" , err, mn_protx_id));
11541164 }
11551165
1156- vote.Relay ();
1166+ // Relay only if we are synchronized
1167+ // Makes no sense to relay votes to the peers from where we are syncing them.
1168+ if (masternodeSync.IsSynced ()) vote.Relay ();
11571169 masternodeSync.AddedBudgetItem (voteID);
11581170 LogPrint (BCLog::MNBUDGET, " fbvote - new vote (%s) for budget %s from dmn %s\n " ,
11591171 voteID.ToString (), vote.GetBudgetHash ().ToString (), mn_protx_id);
@@ -1187,7 +1199,9 @@ bool CBudgetManager::ProcessFinalizedBudgetVote(CFinalizedBudgetVote& vote, CNod
11871199 return state.DoS (0 , false , REJECT_INVALID, " bad-fbvote" , false , err);
11881200 }
11891201
1190- vote.Relay ();
1202+ // Relay only if we are synchronized
1203+ // Makes no sense to relay votes to the peers from where we are syncing them.
1204+ if (masternodeSync.IsSynced ()) vote.Relay ();
11911205 masternodeSync.AddedBudgetItem (voteID);
11921206 LogPrint (BCLog::MNBUDGET, " fbvote - new vote (%s) for budget %s from mn %s\n " ,
11931207 voteID.ToString (), vote.GetBudgetHash ().ToString (), voteVin.prevout .ToString ());
0 commit comments