expired masternodes should not be auto-re-enabled on start, should keep expired state (#1182)

This commit is contained in:
UdjinM6 2016-12-02 21:42:45 +04:00 committed by GitHub
parent d9b1e7734a
commit bc3b349cc1

View File

@ -195,10 +195,6 @@ void CMasternode::Check(bool fForce)
nHeight = chainActive.Height(); nHeight = chainActive.Height();
} }
// keep old masternodes on start, give them a chance to receive an updated ping without removal/expiry
if(!masternodeSync.IsMasternodeListSynced()) nTimeStart = GetTime();
bool fWaitForPing = (GetTime() - nTimeStart < MASTERNODE_MIN_MNP_SECONDS);
if(nActiveState == MASTERNODE_POSE_BAN) { if(nActiveState == MASTERNODE_POSE_BAN) {
if(nHeight < nPoSeBanHeight) return; // too early? if(nHeight < nPoSeBanHeight) return; // too early?
// Otherwise give it a chance to proceed further to do all the usual checks and to change its state. // Otherwise give it a chance to proceed further to do all the usual checks and to change its state.
@ -239,6 +235,12 @@ void CMasternode::Check(bool fForce)
return; return;
} }
// keep old masternodes on start, give them a chance to receive an updated ping without removal/expiry
if(!masternodeSync.IsMasternodeListSynced()) nTimeStart = GetTime();
bool fWaitForPing = (GetTime() - nTimeStart < MASTERNODE_MIN_MNP_SECONDS);
// but if it was already expired before the check - don't wait, check it again now
if(nActiveState == MASTERNODE_EXPIRED) fWaitForPing = false;
if(!fWaitForPing && !IsPingedWithin(MASTERNODE_EXPIRATION_SECONDS)) { if(!fWaitForPing && !IsPingedWithin(MASTERNODE_EXPIRATION_SECONDS)) {
nActiveState = MASTERNODE_EXPIRED; nActiveState = MASTERNODE_EXPIRED;
// RESCAN AFFECTED VOTES // RESCAN AFFECTED VOTES