77
88#include " consensus/validation.h"
99#include " evo/deterministicmns.h"
10- #include " masternode-sync.h"
1110#include " masternodeman.h"
1211#include " netmessagemaker.h"
1312#include " tiertwo/tiertwo_sync_state.h"
@@ -1056,7 +1055,7 @@ void CBudgetManager::NewBlock()
10561055 cleanOrphans (cs_finalizedvotes, mapOrphanFinalizedBudgetVotes, mapSeenFinalizedBudgetVotes);
10571056
10581057 // Once every 2 weeks (1/14 * 1/1440), clean the seen maps
1059- if (masternodeSync .IsSynced () && GetRandInt (1440 ) == 0 ) {
1058+ if (g_tiertwo_sync_state .IsSynced () && GetRandInt (1440 ) == 0 ) {
10601059 ReloadMapSeen ();
10611060 }
10621061
@@ -1089,7 +1088,7 @@ int CBudgetManager::ProcessProposal(CBudgetProposal& proposal)
10891088{
10901089 const uint256& nHash = proposal.GetHash ();
10911090 if (HaveProposal (nHash)) {
1092- masternodeSync .AddedBudgetItem (nHash);
1091+ g_tiertwo_sync_state .AddedBudgetItem (nHash);
10931092 return 0 ;
10941093 }
10951094 if (!AddProposal (proposal)) {
@@ -1099,7 +1098,7 @@ int CBudgetManager::ProcessProposal(CBudgetProposal& proposal)
10991098 // Relay only if we are synchronized
11001099 // Makes no sense to relay proposals to the peers from where we are syncing them.
11011100 if (g_tiertwo_sync_state.IsSynced ()) proposal.Relay ();
1102- masternodeSync .AddedBudgetItem (nHash);
1101+ g_tiertwo_sync_state .AddedBudgetItem (nHash);
11031102
11041103 LogPrint (BCLog::MNBUDGET, " mprop (new) %s\n " , nHash.ToString ());
11051104 // We might have active votes for this proposal that are valid now
@@ -1112,7 +1111,7 @@ bool CBudgetManager::ProcessProposalVote(CBudgetVote& vote, CNode* pfrom, CValid
11121111 const uint256& voteID = vote.GetHash ();
11131112
11141113 if (HaveSeenProposalVote (voteID)) {
1115- masternodeSync .AddedBudgetItem (voteID);
1114+ g_tiertwo_sync_state .AddedBudgetItem (voteID);
11161115 return false ;
11171116 }
11181117
@@ -1150,7 +1149,7 @@ bool CBudgetManager::ProcessProposalVote(CBudgetVote& vote, CNode* pfrom, CValid
11501149 // Relay only if we are synchronized
11511150 // Makes no sense to relay votes to the peers from where we are syncing them.
11521151 if (g_tiertwo_sync_state.IsSynced ()) vote.Relay ();
1153- masternodeSync .AddedBudgetItem (voteID);
1152+ g_tiertwo_sync_state .AddedBudgetItem (voteID);
11541153 LogPrint (BCLog::MNBUDGET, " mvote - new vote (%s) for proposal %s from dmn %s\n " ,
11551154 voteID.ToString (), vote.GetProposalHash ().ToString (), mn_protx_id);
11561155 return true ;
@@ -1187,7 +1186,7 @@ bool CBudgetManager::ProcessProposalVote(CBudgetVote& vote, CNode* pfrom, CValid
11871186 // Relay only if we are synchronized
11881187 // Makes no sense to relay votes to the peers from where we are syncing them.
11891188 if (g_tiertwo_sync_state.IsSynced ()) vote.Relay ();
1190- masternodeSync .AddedBudgetItem (voteID);
1189+ g_tiertwo_sync_state .AddedBudgetItem (voteID);
11911190 LogPrint (BCLog::MNBUDGET, " mvote - new vote (%s) for proposal %s from dmn %s\n " ,
11921191 voteID.ToString (), vote.GetProposalHash ().ToString (), voteVin.prevout .ToString ());
11931192 return true ;
@@ -1198,7 +1197,7 @@ int CBudgetManager::ProcessFinalizedBudget(CFinalizedBudget& finalbudget, CNode*
11981197
11991198 const uint256& nHash = finalbudget.GetHash ();
12001199 if (HaveFinalizedBudget (nHash)) {
1201- masternodeSync .AddedBudgetItem (nHash);
1200+ g_tiertwo_sync_state .AddedBudgetItem (nHash);
12021201 return 0 ;
12031202 }
12041203 if (!AddFinalizedBudget (finalbudget, pfrom)) {
@@ -1208,7 +1207,7 @@ int CBudgetManager::ProcessFinalizedBudget(CFinalizedBudget& finalbudget, CNode*
12081207 // Relay only if we are synchronized
12091208 // Makes no sense to relay finalizations to the peers from where we are syncing them.
12101209 if (g_tiertwo_sync_state.IsSynced ()) finalbudget.Relay ();
1211- masternodeSync .AddedBudgetItem (nHash);
1210+ g_tiertwo_sync_state .AddedBudgetItem (nHash);
12121211
12131212 LogPrint (BCLog::MNBUDGET, " fbs (new) %s\n " , nHash.ToString ());
12141213 // we might have active votes for this budget that are now valid
@@ -1221,7 +1220,7 @@ bool CBudgetManager::ProcessFinalizedBudgetVote(CFinalizedBudgetVote& vote, CNod
12211220 const uint256& voteID = vote.GetHash ();
12221221
12231222 if (HaveSeenFinalizedBudgetVote (voteID)) {
1224- masternodeSync .AddedBudgetItem (voteID);
1223+ g_tiertwo_sync_state .AddedBudgetItem (voteID);
12251224 return false ;
12261225 }
12271226
@@ -1259,7 +1258,7 @@ bool CBudgetManager::ProcessFinalizedBudgetVote(CFinalizedBudgetVote& vote, CNod
12591258 // Relay only if we are synchronized
12601259 // Makes no sense to relay votes to the peers from where we are syncing them.
12611260 if (g_tiertwo_sync_state.IsSynced ()) vote.Relay ();
1262- masternodeSync .AddedBudgetItem (voteID);
1261+ g_tiertwo_sync_state .AddedBudgetItem (voteID);
12631262 LogPrint (BCLog::MNBUDGET, " fbvote - new vote (%s) for budget %s from dmn %s\n " ,
12641263 voteID.ToString (), vote.GetBudgetHash ().ToString (), mn_protx_id);
12651264 return true ;
@@ -1295,7 +1294,7 @@ bool CBudgetManager::ProcessFinalizedBudgetVote(CFinalizedBudgetVote& vote, CNod
12951294 // Relay only if we are synchronized
12961295 // Makes no sense to relay votes to the peers from where we are syncing them.
12971296 if (g_tiertwo_sync_state.IsSynced ()) vote.Relay ();
1298- masternodeSync .AddedBudgetItem (voteID);
1297+ g_tiertwo_sync_state .AddedBudgetItem (voteID);
12991298 LogPrint (BCLog::MNBUDGET, " fbvote - new vote (%s) for budget %s from mn %s\n " ,
13001299 voteID.ToString (), vote.GetBudgetHash ().ToString (), voteVin.prevout .ToString ());
13011300 return true ;
0 commit comments