Merge pull request #237 from UdjinM6/v0.11.2.x_9999_mainnet_only

V0.11.2.x allow port 9999 for MNs on mainnet only
This commit is contained in:
evan82 2015-03-12 17:12:01 -07:00
commit 3fdb01087d
3 changed files with 16 additions and 4 deletions

View File

@ -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<string>(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){

View File

@ -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);
}

View File

@ -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);