From 087d3d22df16131417d27f695b42d0a226fe3189 Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Tue, 15 Nov 2016 21:09:37 -0500 Subject: [PATCH 1/2] Remove unused CMasternodeMan method and argument --- src/masternodeman.cpp | 21 ++------------------- src/masternodeman.h | 4 +--- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index c83dd8737..977a37487 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -167,7 +167,7 @@ void CMasternodeMan::Check() } } -void CMasternodeMan::CheckAndRemove(bool fForceExpiredRemoval) +void CMasternodeMan::CheckAndRemove() { LogPrintf("CMasternodeMan::CheckAndRemove\n"); @@ -182,9 +182,7 @@ void CMasternodeMan::CheckAndRemove(bool fForceExpiredRemoval) bool fRemove = // If it's marked to be removed from the list by CMasternode::Check for whatever reason ... (*it).nActiveState == CMasternode::MASTERNODE_REMOVE || // or collateral was spent ... - (*it).nActiveState == CMasternode::MASTERNODE_OUTPOINT_SPENT || - // or we were asked to remove exired entries ... - (fForceExpiredRemoval && (*it).nActiveState == CMasternode::MASTERNODE_EXPIRED); + (*it).nActiveState == CMasternode::MASTERNODE_OUTPOINT_SPENT; if (fRemove) { LogPrint("masternode", "CMasternodeMan::CheckAndRemove -- Removing Masternode: %s addr=%s %i now\n", (*it).GetStatus(), (*it).addr.ToString(), size() - 1); @@ -1235,21 +1233,6 @@ void CMasternodeMan::ProcessVerifyBroadcast(CNode* pnode, const CMasternodeVerif } } -void CMasternodeMan::Remove(CTxIn vin) -{ - LOCK(cs); - - std::vector::iterator it = vMasternodes.begin(); - while(it != vMasternodes.end()) { - if((*it).vin == vin) { - LogPrint("masternode", "CMasternodeMan::Remove -- Removing Masternode: %s addr=%s, %i now\n", vin.prevout.ToStringShort(), (*it).addr.ToString(), size() - 1); - vMasternodes.erase(it); - break; - } - ++it; - } -} - std::string CMasternodeMan::ToString() const { std::ostringstream info; diff --git a/src/masternodeman.h b/src/masternodeman.h index 398eee766..61c5c8144 100644 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -194,7 +194,7 @@ public: void Check(); /// Check all Masternodes and remove inactive - void CheckAndRemove(bool fForceExpiredRemoval = false); + void CheckAndRemove(); /// Clear Masternode vector void Clear(); @@ -297,8 +297,6 @@ public: std::string ToString() const; - void Remove(CTxIn vin); - int GetEstimatedMasternodes(int nBlock); /// Update masternode list and maps using provided CMasternodeBroadcast From ad0e3514c2652e430f6ede720e831816ad5dfdaf Mon Sep 17 00:00:00 2001 From: Tim Flynn Date: Tue, 15 Nov 2016 21:31:14 -0500 Subject: [PATCH 2/2] Added indexMasternodes to CMasternodeMan::Clear() --- src/masternodeman.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 977a37487..ce62e093a 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -295,6 +295,8 @@ void CMasternodeMan::Clear() mapSeenMasternodePing.clear(); nDsqCount = 0; nLastWatchdogVoteTime = 0; + indexMasternodes.Clear(); + indexMasternodesOld.Clear(); } int CMasternodeMan::CountMasternodes(int nProtocolVersion)