do not check mn unless only active requested

This commit is contained in:
UdjinM6 2015-03-24 05:02:22 +03:00
parent 0fd7c655a4
commit cfc4bbd986

View File

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