From 6651abe343a2bf8ad65679edef9f563ae05cc270 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 14 Jul 2015 09:27:34 +0300 Subject: [PATCH] lower mn reuse rate --- src/darksend.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/darksend.cpp b/src/darksend.cpp index bf2fe8f432..85650e61ac 100644 --- a/src/darksend.cpp +++ b/src/darksend.cpp @@ -2408,9 +2408,13 @@ void ThreadCheckDarkSendPool() } if(c % 60 == 0){ - //if we've used 1/5 of the Masternode list, then clear the list. - if((int)vecMasternodesUsed.size() > (int)mnodeman.size() / 5) - vecMasternodesUsed.clear(); + //if we've used 90% of the Masternode list then drop all the oldest. + int nThreshold = (int)(mnodeman.CountEnabled() * 0.9); + if(fDebug) LogPrintf("Checking vecMasternodesUsed size %d threshold %d\n", (int)vecMasternodesUsed.size(), nThreshold); + while((int)vecMasternodesUsed.size() > nThreshold){ + vecMasternodesUsed.erase(vecMasternodesUsed.begin()); + if(fDebug) LogPrintf(" vecMasternodesUsed size %d threshold %d\n", (int)vecMasternodesUsed.size(), nThreshold); + } } if(darkSendPool.GetState() == POOL_STATUS_IDLE && c % 6 == 0){