From cfc4bbd986e9d2d600a364f111e1b1a9c4daf2be Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 24 Mar 2015 05:02:22 +0300 Subject: [PATCH] do not check mn unless only active requested --- src/masternodeman.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 85b2c8081..8d210d2b0 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -391,11 +391,10 @@ int CMasternodeMan::GetMasternodeRank(const CTxIn& vin, int64_t nBlockHeight, in // scan for winner BOOST_FOREACH(CMasternode& mn, vMasternodes) { - mn.Check(); - if(mn.protocolVersion < minProtocol) continue; - if(fOnlyActive && !mn.IsEnabled()) { - continue; + if(fOnlyActive) { + mn.Check(); + if(!mn.IsEnabled()) continue; } uint256 n = mn.CalculateScore(1, nBlockHeight); @@ -462,11 +461,10 @@ CMasternode* CMasternodeMan::GetMasternodeByRank(int nRank, int64_t nBlockHeight // scan for winner BOOST_FOREACH(CMasternode& mn, vMasternodes) { - mn.Check(); - if(mn.protocolVersion < minProtocol) continue; - if(fOnlyActive && !mn.IsEnabled()) { - continue; + if(fOnlyActive) { + mn.Check(); + if(!mn.IsEnabled()) continue; } uint256 n = mn.CalculateScore(1, nBlockHeight);