Deprecate masternodeaddr (#1048)

* Deprecate masternodeaddr (i.e. remove dash.conf-started remote masternode support)
This commit is contained in:
UdjinM6 2016-09-29 00:02:54 +04:00 committed by GitHub
parent ac9ed3545b
commit 2b3478387c
3 changed files with 8 additions and 22 deletions

View File

@ -59,15 +59,11 @@ void CActiveMasternode::ManageState()
return; return;
} }
if(strMasterNodeAddr.empty()) {
if(!GetLocal(service)) { if(!GetLocal(service)) {
strNotCapableReason = "Can't detect external address. Please use the masternodeaddr configuration option."; strNotCapableReason = "Can't detect external address. Please consider using the externalip configuration option if problem persists.";
LogPrintf("CActiveMasternode::ManageState -- not capable: %s\n", strNotCapableReason); LogPrintf("CActiveMasternode::ManageState -- not capable: %s\n", strNotCapableReason);
return; return;
} }
} else {
service = CService(strMasterNodeAddr);
}
int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort(); int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort();
if(Params().NetworkIDString() == CBaseChainParams::MAIN) { if(Params().NetworkIDString() == CBaseChainParams::MAIN) {

View File

@ -30,8 +30,6 @@ private:
bool SendMasternodePing(std::string& strErrorRet); bool SendMasternodePing(std::string& strErrorRet);
public: public:
// Initialized by init.cpp
std::string strMasterNodeAddr;
// Keys for the active Masternode // Keys for the active Masternode
CPubKey pubKeyMasternode; CPubKey pubKeyMasternode;
CKey keyMasternode; CKey keyMasternode;

View File

@ -1784,20 +1784,12 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if(fMasterNode) { if(fMasterNode) {
LogPrintf("MASTERNODE:\n"); LogPrintf("MASTERNODE:\n");
activeMasternode.strMasterNodeAddr = GetArg("-masternodeaddr", "");
CService service; if(!GetArg("-masternodeaddr", "").empty()) {
if(activeMasternode.strMasterNodeAddr.empty()) { // Hot masternode (either local or remote) should get its address in
if(!GetLocal(service)) { // CActiveMasternode::ManageState() automatically and no longer relies on masternodeaddr.
LogPrintf("Can't detect external address. Please consider using the masternodeaddr configuration option.\n"); return InitError(_("masternodeaddr option is deprecated. Please use masternode.conf to manage your remote masterndodes."));
} }
} else {
service = CService(activeMasternode.strMasterNodeAddr);
if (!service.IsValid()) {
return InitError("Invalid masternodeaddr: " + activeMasternode.strMasterNodeAddr);
}
}
LogPrintf(" service: %s\n", service.ToString());
std::string strMasterNodePrivKey = GetArg("-masternodeprivkey", ""); std::string strMasterNodePrivKey = GetArg("-masternodeprivkey", "");
if(!strMasterNodePrivKey.empty()) { if(!strMasterNodePrivKey.empty()) {