diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index bed502b69..ee5931cec 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -49,6 +49,11 @@ void CActiveMasternode::ManageStatus() LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason.c_str()); return; } + } else if(service.GetPort() == 9999) { + notCapableReason = "Invalid port: " + boost::lexical_cast(service.GetPort()) + " - 9999 is only supported on mainnet."; + status = MASTERNODE_NOT_CAPABLE; + LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason.c_str()); + return; } if(Params().NetworkID() == CChainParams::MAIN){ diff --git a/src/masternodeconfig.cpp b/src/masternodeconfig.cpp index 4f32dd563..ca9fa798b 100644 --- a/src/masternodeconfig.cpp +++ b/src/masternodeconfig.cpp @@ -29,11 +29,18 @@ bool CMasternodeConfig::read(std::string& strErr) { return false; } -/* if(CService(ip).GetPort() != 19999 && CService(ip).GetPort() != 9999) { - strErr = "Invalid port (must be 9999 for mainnet or 19999 for testnet) detected in masternode.conf: " + line; + if(Params().NetworkID() == CChainParams::MAIN){ + if(CService(ip).GetPort() != 9999) { + strErr = "Invalid port detected in masternode.conf: " + line + " (must be 9999 for mainnet)"; + streamConfig.close(); + return false; + } + } else if(CService(ip).GetPort() == 9999) { + strErr = "Invalid port detected in masternode.conf: " + line + " (9999 must be only on mainnet)"; streamConfig.close(); return false; - }*/ + } + add(alias, ip, privKey, txHash, outputIndex); } diff --git a/src/masternodeman.cpp b/src/masternodeman.cpp index 8c3972cb3..3379f4c61 100644 --- a/src/masternodeman.cpp +++ b/src/masternodeman.cpp @@ -539,7 +539,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData if(Params().NetworkID() == CChainParams::MAIN){ if(addr.GetPort() != 9999) return; - } + } else if(addr.GetPort() == 9999) return; //search existing Masternode list, this is where we update existing Masternodes with new dsee broadcasts CMasternode* pmn = this->Find(vin);