Skip to content

Commit

Permalink
Force masternodes to have listen=1 and maxconnections to be at least …
Browse files Browse the repository at this point in the history
…DEFAULT_MAX_PEER_CONNECTIONS (dashpay#1935)
  • Loading branch information
UdjinM6 authored and CryptoCentric committed Feb 28, 2019
1 parent 786edeb commit b4568fb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,9 +821,14 @@ void InitParameterInteraction()
}

if (GetBoolArg("-masternode", false)) {
// masternodes must accept connections from outside
if (SoftSetBoolArg("-listen", true))
LogPrintf("%s: parameter interaction: -masternode=1 -> setting -listen=1\n", __func__);
// masternodes MUST accept connections from outside
ForceSetArg("-listen", "1");
LogPrintf("%s: parameter interaction: -masternode=1 -> setting -listen=1\n", __func__);
if (GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS) < DEFAULT_MAX_PEER_CONNECTIONS) {
// masternodes MUST be able to handle at least DEFAULT_MAX_PEER_CONNECTIONS connections
ForceSetArg("-maxconnections", itostr(DEFAULT_MAX_PEER_CONNECTIONS));
LogPrintf("%s: parameter interaction: -masternode=1 -> setting -maxconnections=%d\n", __func__, DEFAULT_MAX_PEER_CONNECTIONS);
}
}

if (mapMultiArgs.count("-connect") && mapMultiArgs.at("-connect").size() > 0) {
Expand Down

0 comments on commit b4568fb

Please sign in to comment.