From e8ba7328f04ed32c5b6adb7a54593a3b0d056bd2 Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Sat, 8 Aug 2015 13:56:12 -0700 Subject: [PATCH] Clear seen on boot and everyday --- src/init.cpp | 1 + src/masternode-budget.cpp | 5 ++++- src/masternode-budget.h | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index f6e3233ff..83002ce4b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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...")); diff --git a/src/masternode-budget.cpp b/src/masternode-budget.cpp index 241a5c0a6..4f65d0625 100644 --- a/src/masternode-budget.cpp +++ b/src/masternode-budget.cpp @@ -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) diff --git a/src/masternode-budget.h b/src/masternode-budget.h index 3c08d1aeb..c2410424e 100644 --- a/src/masternode-budget.h +++ b/src/masternode-budget.h @@ -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();}