Fix Hot Masternode Starting (#1239)

This commit is contained in:
TheLazieR Yip 2017-01-01 17:18:21 +07:00 committed by UdjinM6
parent 7815f6e32e
commit 89d14c5274

View File

@ -40,7 +40,10 @@ void CActiveMasternode::ManageState()
if(eType == MASTERNODE_REMOTE) { if(eType == MASTERNODE_REMOTE) {
ManageStateRemote(); ManageStateRemote();
} else if(eType == MASTERNODE_LOCAL) { } else if(eType == MASTERNODE_LOCAL) {
ManageStateLocal(); // Try Remote Start first so the started local masternode can be restarted without recreate masternode broadcast.
ManageStateRemote();
if(nState != ACTIVE_MASTERNODE_STARTED)
ManageStateLocal();
} }
SendMasternodePing(); SendMasternodePing();
@ -301,9 +304,6 @@ void CActiveMasternode::ManageStateLocal()
fPingerEnabled = true; fPingerEnabled = true;
nState = ACTIVE_MASTERNODE_STARTED; nState = ACTIVE_MASTERNODE_STARTED;
masternode_info_t infoMn = mnodeman.GetMasternodeInfo(pubKeyMasternode);
if(infoMn.fInfoValid && CMasternode::IsValidStateForAutoStart(infoMn.nActiveState)) return; // sending ping should be enough
//update to masternode list //update to masternode list
LogPrintf("CActiveMasternode::ManageStateLocal -- Update Masternode List\n"); LogPrintf("CActiveMasternode::ManageStateLocal -- Update Masternode List\n");
mnodeman.UpdateMasternodeList(mnb); mnodeman.UpdateMasternodeList(mnb);