Clear seen on boot and everyday

This commit is contained in:
Evan Duffield 2015-08-08 13:56:12 -07:00
parent 7d51866b9d
commit e8ba7328f0
3 changed files with 12 additions and 1 deletions

View File

@ -1442,6 +1442,7 @@ bool AppInit2(boost::thread_group& threadGroup)
//flag our cached items so we send them to our peers //flag our cached items so we send them to our peers
budget.ResetSync(); budget.ResetSync();
budget.ClearSeen();
uiInterface.InitMessage(_("Loading masternode payment cache...")); uiInterface.InitMessage(_("Loading masternode payment cache..."));

View File

@ -785,7 +785,10 @@ void CBudgetManager::NewBlock()
// incremental sync with our peers // incremental sync with our peers
if(masternodeSync.IsSynced()){ if(masternodeSync.IsSynced()){
LogPrintf("CBudgetManager::NewBlock - incremental sync started"); LogPrintf("CBudgetManager::NewBlock - incremental sync started");
if(chainActive.Height() % 600 == rand() % 600) ResetSync(); if(chainActive.Height() % 600 == rand() % 600) {
ClearSeen();
ResetSync();
}
LOCK(cs_vNodes); LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes) BOOST_FOREACH(CNode* pnode, vNodes)

View File

@ -102,6 +102,13 @@ public:
mapFinalizedBudgets.clear(); mapFinalizedBudgets.clear();
} }
void ClearSeen() {
mapSeenMasternodeBudgetProposals.clear();
mapSeenMasternodeBudgetVotes.clear();
mapSeenFinalizedBudgets.clear();
mapSeenFinalizedBudgetVotes.clear();
}
int sizeFinalized() {return (int)mapFinalizedBudgets.size();} int sizeFinalized() {return (int)mapFinalizedBudgets.size();}
int sizeProposals() {return (int)mapProposals.size();} int sizeProposals() {return (int)mapProposals.size();}