enforce mn port on mainnet only
This commit is contained in:
parent
012f0e5660
commit
c56a54d211
@ -41,6 +41,15 @@ void CActiveMasternode::ManageStatus()
|
||||
|
||||
LogPrintf("CActiveMasternode::ManageStatus() - Checking inbound connection to '%s'\n", service.ToString().c_str());
|
||||
|
||||
if(Params().NetworkID() == CChainParams::MAIN){
|
||||
if(service.GetPort() != 9999) {
|
||||
notCapableReason = "Invalid port: " + boost::lexical_cast<string>(service.GetPort()) + " -only 9999 is supported on mainnet.";
|
||||
status = MASTERNODE_NOT_CAPABLE;
|
||||
LogPrintf("CActiveMasternode::ManageStatus() - not capable: %s\n", notCapableReason.c_str());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(Params().NetworkID() != CChainParams::REGTEST){
|
||||
if(!ConnectNode((CAddress)service, service.ToString().c_str())){
|
||||
notCapableReason = "Could not connect to " + service.ToString();
|
||||
|
@ -105,6 +105,10 @@ void ProcessMessageMasternode(CNode* pfrom, std::string& strCommand, CDataStream
|
||||
return;
|
||||
}
|
||||
|
||||
if(Params().NetworkID() == CChainParams::MAIN){
|
||||
if(addr.GetPort() != 9999) return;
|
||||
}
|
||||
|
||||
//search existing masternode list, this is where we update existing masternodes with new dsee broadcasts
|
||||
|
||||
BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
|
||||
|
@ -33,7 +33,7 @@ static const int PROTOCOL_VERSION = 70062;
|
||||
static const int INIT_PROTO_VERSION = 209;
|
||||
|
||||
// disconnect from peers older than this proto version
|
||||
static const int MIN_PEER_PROTO_VERSION = 70062; //70051
|
||||
static const int MIN_PEER_PROTO_VERSION = 70051;
|
||||
|
||||
// nTime field added to CAddress, starting with this version;
|
||||
// if possible, avoid requesting addresses nodes older than this
|
||||
|
Loading…
Reference in New Issue
Block a user