Skip to content

Commit 0b2221e

Browse files
PastaPastaPastaUdjinM6
authored andcommitted
Clarify default max peer connections (#3081)
* clarify comment regarding default peer connections and how that applies to MNs Signed-off-by: Pasta <pasta@dashboost.org> * clarify debug log when maxconnections is force set Signed-off-by: Pasta <pasta@dashboost.org>
1 parent b874fcc commit 0b2221e

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/init.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,8 @@ void InitParameterInteraction()
913913
if (gArgs.GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS) < DEFAULT_MAX_PEER_CONNECTIONS) {
914914
// masternodes MUST be able to handle at least DEFAULT_MAX_PEER_CONNECTIONS connections
915915
gArgs.ForceSetArg("-maxconnections", itostr(DEFAULT_MAX_PEER_CONNECTIONS));
916-
LogPrintf("%s: parameter interaction: -masternode=1 -> setting -maxconnections=%d\n", __func__, DEFAULT_MAX_PEER_CONNECTIONS);
916+
LogPrintf("%s: parameter interaction: -masternode=1 -> setting -maxconnections=%d instead of specified -maxconnections=%d\n",
917+
__func__, DEFAULT_MAX_PEER_CONNECTIONS, gArgs.GetArg("-maxconnections", DEFAULT_MAX_PEER_CONNECTIONS));
917918
}
918919
}
919920

src/net.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ static const bool DEFAULT_UPNP = false;
9696
static const size_t MAPASKFOR_MAX_SZ = MAX_INV_SZ;
9797
/** The maximum number of entries in setAskFor (larger due to getdata latency)*/
9898
static const size_t SETASKFOR_MAX_SZ = 2 * MAX_INV_SZ;
99-
/** The maximum number of peer connections to maintain. */
99+
/** The maximum number of peer connections to maintain.
100+
* Masternodes are forced to accept at least this many connections
101+
*/
100102
static const unsigned int DEFAULT_MAX_PEER_CONNECTIONS = 125;
101103
/** The default for -maxuploadtarget. 0 = Unlimited */
102104
static const uint64_t DEFAULT_MAX_UPLOAD_TARGET = 0;

0 commit comments

Comments
 (0)