void CActiveMasternode::ManageState(CConnman& connman) { LogPrint("masternode", "CActiveMasternode::ManageState -- Start\n"); if(!fMasterNode) { LogPrint("masternode", "CActiveMasternode::ManageState -- Not a masternode, returning\n"); return; } if(Params().NetworkIDString() != CBaseChainParams::REGTEST && !masternodeSync.IsBlockchainSynced()) { nState = ACTIVE_MASTERNODE_SYNC_IN_PROCESS; LogPrintf("CActiveMasternode::ManageState -- %s: %s\n", GetStateString(), GetStatus()); return; } if(nState == ACTIVE_MASTERNODE_SYNC_IN_PROCESS) { nState = ACTIVE_MASTERNODE_INITIAL; } LogPrint("masternode", "CActiveMasternode::ManageState -- status = %s, type = %s, pinger enabled = %d\n", GetStatus(), GetTypeString(), fPingerEnabled); if(eType == MASTERNODE_UNKNOWN) { ManageStateInitial(connman); } if(eType == MASTERNODE_REMOTE) { ManageStateRemote(); } else if(eType == MASTERNODE_LOCAL) { // Try Remote Start first so the started local masternode can be restarted without recreate masternode broadcast. ManageStateRemote(); if(nState != ACTIVE_MASTERNODE_STARTED) ManageStateLocal(connman); } SendMasternodePing(connman); }
void CActiveLegacyMasternodeManager::ManageState(CConnman& connman) { if (deterministicMNManager->IsDeterministicMNsSporkActive()) return; LogPrint("masternode", "CActiveLegacyMasternodeManager::ManageState -- Start\n"); if (!fMasternodeMode) { LogPrint("masternode", "CActiveLegacyMasternodeManager::ManageState -- Not a masternode, returning\n"); return; } if (Params().NetworkIDString() != CBaseChainParams::REGTEST && !masternodeSync.IsBlockchainSynced()) { nState = ACTIVE_MASTERNODE_SYNC_IN_PROCESS; LogPrintf("CActiveLegacyMasternodeManager::ManageState -- %s: %s\n", GetStateString(), GetStatus()); return; } if (nState == ACTIVE_MASTERNODE_SYNC_IN_PROCESS) { nState = ACTIVE_MASTERNODE_INITIAL; } LogPrint("masternode", "CActiveLegacyMasternodeManager::ManageState -- status = %s, type = %s, pinger enabled = %d\n", GetStatus(), GetTypeString(), fPingerEnabled); if (eType == MASTERNODE_UNKNOWN) { ManageStateInitial(connman); } if (eType == MASTERNODE_REMOTE) { ManageStateRemote(); } SendMasternodePing(connman); }