Commit 177125ac authored by Evan Duffield's avatar Evan Duffield
Browse files

Clear seen on boot and everyday

parent 309085d6
Showing with 12 additions and 1 deletion
+12 -1
......@@ -1442,6 +1442,7 @@ bool AppInit2(boost::thread_group& threadGroup)
//flag our cached items so we send them to our peers
budget.ResetSync();
budget.ClearSeen();
uiInterface.InitMessage(_("Loading masternode payment cache..."));
......
......@@ -785,7 +785,10 @@ void CBudgetManager::NewBlock()
// incremental sync with our peers
if(masternodeSync.IsSynced()){
LogPrintf("CBudgetManager::NewBlock - incremental sync started");
if(chainActive.Height() % 600 == rand() % 600) ResetSync();
if(chainActive.Height() % 600 == rand() % 600) {
ClearSeen();
ResetSync();
}
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
......
......@@ -102,6 +102,13 @@ public:
mapFinalizedBudgets.clear();
}
void ClearSeen() {
mapSeenMasternodeBudgetProposals.clear();
mapSeenMasternodeBudgetVotes.clear();
mapSeenFinalizedBudgets.clear();
mapSeenFinalizedBudgetVotes.clear();
}
int sizeFinalized() {return (int)mapFinalizedBudgets.size();}
int sizeProposals() {return (int)mapProposals.size();}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment