diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index 4dfd387a7..c4dc2de8a 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -118,8 +118,7 @@ bool CActiveMasternode::SendMasternodePing(std::string& strErrorRet) void CActiveMasternode::ManageStateInitial() { - LogPrint("masternode", "CActiveMasternode::ManageStateInitial -- Start status = %s, type = %s, pinger enabled = %d\n", GetStatus(), GetType(), fPingerEnabled); - + LogPrint("masternode", "CActiveMasternode::ManageStateInitial -- status = %s, type = %s, pinger enabled = %d\n", GetStatus(), GetType(), fPingerEnabled); // Check that our local network configuration is correct if(!GetLocal(service)) { strNotCapableReason = "Can't detect external address. Please consider using the externalip configuration option if problem persists."; @@ -184,7 +183,12 @@ void CActiveMasternode::ManageStateInitial() void CActiveMasternode::ManageStateRemote() { - LogPrint("masternode", "CActiveMasternode::ManageStateRemote -- status = %s, type = %s, pinger enabled = %d\n", GetStatus(), GetType(), fPingerEnabled); + LogPrint("masternode", "CActiveMasternode::ManageStateRemote -- Start status = %s, type = %s, pinger enabled = %d, pubKeyMasternode.GetID() = %s\n", + GetStatus(), + GetType(), + fPingerEnabled, + pubKeyMasternode.GetID().ToString()); + mnodeman.CheckMasternode(pubKeyMasternode); masternode_info_t infoMn = mnodeman.GetMasternodeInfo(pubKeyMasternode); if(infoMn.fInfoValid) { diff --git a/src/masternode.cpp b/src/masternode.cpp index a5e6d7e73..226b53eb9 100644 --- a/src/masternode.cpp +++ b/src/masternode.cpp @@ -393,6 +393,11 @@ bool CMasternodeBroadcast::Create(CTxIn txin, CService service, CKey keyCollater // wait for reindex and/or import to finish if (fImporting || fReindex) return false; + LogPrint("masternode", "CMasternodeBroadcast::Create -- pubKeyCollateralAddressNew = %s, pubKeyMasternodeNew.GetID() = %s\n", + CBitcoinAddress(pubKeyCollateralAddressNew.GetID()).ToString(), + pubKeyMasternodeNew.GetID().ToString()); + + CMasternodePing mnp(txin); if(!mnp.Sign(keyMasternodeNew, pubKeyMasternodeNew)) { strErrorRet = strprintf("Failed to sign ping, masternode=%s", txin.prevout.ToStringShort()); @@ -509,9 +514,6 @@ bool CMasternodeBroadcast::Update(CMasternode* pmn, int& nDos) return false; } - // masternode is not enabled yet/already, nothing to update - if(!pmn->IsEnabled()) return false; - // IsVnAssociatedWithPubkey is validated once in CheckOutpoint, after that they just need to match if(pmn->pubKeyCollateralAddress != pubKeyCollateralAddress) { LogPrintf("CMasternodeMan::Update -- Got mismatched pubKeyCollateralAddress and vin\n"); @@ -525,10 +527,7 @@ bool CMasternodeBroadcast::Update(CMasternode* pmn, int& nDos) LogPrintf("CMasternodeBroadcast::Update -- Got UPDATED Masternode entry: addr=%s\n", addr.ToString()); if(pmn->UpdateFromNewBroadcast((*this))) { pmn->Check(); - // normally masternode should be in pre-enabled status after update, if not - do not relay - if(pmn->IsPreEnabled()) { - Relay(); - } + Relay(); } masternodeSync.AddedMasternodeList(); }