Merge branch 'v0.12.0.x_lower_mn_reuse' of https://github.com/UdjinM6/dash into UdjinM6-v0.12.0.x_lower_mn_reuse

This commit is contained in:
Evan Duffield 2015-07-14 07:44:22 -07:00
commit 665a93cd4f

View File

@ -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){