From 2f63f98e508ab67130d9f18ba1d1fbe4488d840f Mon Sep 17 00:00:00 2001 From: Evan Duffield Date: Sat, 8 Aug 2015 12:29:31 -0700 Subject: [PATCH] Add sync mode for budget processing --- src/masternode-budget.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/masternode-budget.cpp b/src/masternode-budget.cpp index 0bedb647e..33c0bb0bf 100644 --- a/src/masternode-budget.cpp +++ b/src/masternode-budget.cpp @@ -777,6 +777,19 @@ void CBudgetManager::NewBlock() SubmitFinalBudget(); } + if (strBudgetMode == "suggest" || strBudgetMode == "sync") { + //this function should be called 1/60 blocks -- sync with our peers + // -- this will send any unknown items to our peers that came active + // -- todo: make this more effective / less bandwidth + + if(chainActive.Height() % 60 == 0) { + LOCK(cs_vNodes); + BOOST_FOREACH(CNode* pnode, vNodes) + if(pnode->nVersion >= MIN_BUDGET_PEER_PROTO_VERSION) + Sync(pnode, 0); + } + } + //this function should be called 1/6 blocks, allowing up to 100 votes per day on all proposals if(chainActive.Height() % 6 != 0) return;