Skip to content

Commit

Permalink
Reverted previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MidoriChainDev committed Oct 31, 2018
1 parent b82cdfd commit 5e57e5d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/activemasternode.cpp
Expand Up @@ -67,6 +67,18 @@ void CActiveMasternode::ManageStatus()
service = CService(strMasterNodeAddr);
}

if (Params().NetworkID() == CBaseChainParams::MAIN) {
if (service.GetPort() != 50607) {
notCapableReason = strprintf("Invalid port: %u - only 50607 is supported on mainnet.", service.GetPort());
LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason);
return;
}
} else if (service.GetPort() == 50607) {
notCapableReason = strprintf("Invalid port: %u - 50607 is only supported on mainnet.", service.GetPort());
LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason);
return;
}

LogPrintf("CActiveMasternode::ManageStatus() - Checking inbound connection to '%s'\n", service.ToString());

CNode* pnode = ConnectNode((CAddress)service, NULL, false);
Expand Down Expand Up @@ -481,4 +493,4 @@ bool CActiveMasternode::EnableHotColdMasterNode(CTxIn& newVin, CService& newServ
LogPrintf("CActiveMasternode::EnableHotColdMasterNode() - Enabled! You may shut down the cold daemon.\n");

return true;
}
}
16 changes: 15 additions & 1 deletion src/masternode.cpp
Expand Up @@ -412,6 +412,20 @@ bool CMasternodeBroadcast::Create(std::string strService, std::string strKeyMast
return false;
}

CService service = CService(strService);
int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort();
if (Params().NetworkID() == CBaseChainParams::MAIN) {
if (service.GetPort() != mainnetDefaultPort) {
strErrorRet = strprintf("Invalid port %u for masternode %s, only %d is supported on mainnet.", service.GetPort(), strService, mainnetDefaultPort);
LogPrint("masternode", "CMasternodeBroadcast::Create -- %s\n", strErrorRet);
return false;
}
} else if (service.GetPort() == mainnetDefaultPort) {
strErrorRet = strprintf("Invalid port %u for masternode %s, %d is the only supported on mainnet.", service.GetPort(), strService, mainnetDefaultPort);
LogPrint("masternode", "CMasternodeBroadcast::Create -- %s\n", strErrorRet);
return false;
}

return Create(txin, CService(strService), keyCollateralAddressNew, pubKeyCollateralAddressNew, keyMasternodeNew, pubKeyMasternodeNew, strErrorRet, mnbRet);
}

Expand Down Expand Up @@ -763,4 +777,4 @@ void CMasternodePing::Relay()
{
CInv inv(MSG_MASTERNODE_PING, GetHash());
RelayInv(inv);
}
}

0 comments on commit 5e57e5d

Please sign in to comment.