Skip to content

Commit df69b22

Browse files
doc: improve documentation around connection limit maximums
Co-authored-by: Martin Zumsande <mzumsande@gmail.com>
1 parent adc171e commit df69b22

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ void SetupServerArgs(ArgsManager& argsman)
489489
argsman.AddArg("-forcednsseed", strprintf("Always query for peer addresses via DNS lookup (default: %u)", DEFAULT_FORCEDNSSEED), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
490490
argsman.AddArg("-listen", strprintf("Accept connections from outside (default: %u if no -proxy, -connect or -maxconnections=0)", DEFAULT_LISTEN), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
491491
argsman.AddArg("-listenonion", strprintf("Automatically create Tor onion service (default: %d)", DEFAULT_LISTEN_ONION), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
492-
argsman.AddArg("-maxconnections=<n>", strprintf("Maintain at most <n> connections to peers (default: %u). This limit does not apply to connections manually added via -addnode or the addnode RPC, which have a separate limit of %u.", DEFAULT_MAX_PEER_CONNECTIONS, MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
492+
argsman.AddArg("-maxconnections=<n>", strprintf("Maintain at most <n> automatic connections to peers (default: %u). This limit does not apply to connections manually added via -addnode or the addnode RPC, which have a separate limit of %u.", DEFAULT_MAX_PEER_CONNECTIONS, MAX_ADDNODE_CONNECTIONS), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
493493
argsman.AddArg("-maxreceivebuffer=<n>", strprintf("Maximum per-connection receive buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXRECEIVEBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
494494
argsman.AddArg("-maxsendbuffer=<n>", strprintf("Maximum per-connection memory usage for the send buffer, <n>*1000 bytes (default: %u)", DEFAULT_MAXSENDBUFFER), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);
495495
argsman.AddArg("-maxtimeadjustment", strprintf("Maximum allowed median peer time offset adjustment. Local perspective of time may be influenced by outbound peers forward or backward by this amount (default: %u seconds).", DEFAULT_MAX_TIME_ADJUSTMENT), ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION);

src/net.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,8 +1474,19 @@ class CConnman
14741474

14751475
std::unique_ptr<CSemaphore> semOutbound;
14761476
std::unique_ptr<CSemaphore> semAddnode;
1477+
1478+
/**
1479+
* Maximum number of automatic connections permitted, excluding manual
1480+
* connections but including inbounds. May be changed by the user and is
1481+
* potentially limited by the operating system (number of file descriptors).
1482+
*/
14771483
int m_max_automatic_connections;
14781484

1485+
/*
1486+
* Maximum number of peers by connection type. Might vary from defaults
1487+
* based on -maxconnections init value.
1488+
*/
1489+
14791490
// How many full-relay (tx, block, addr) outbound peers we want
14801491
int m_max_outbound_full_relay;
14811492

@@ -1487,6 +1498,7 @@ class CConnman
14871498
int m_max_feeler{MAX_FEELER_CONNECTIONS};
14881499
int m_max_automatic_outbound;
14891500
int m_max_inbound;
1501+
14901502
bool m_use_addrman_outgoing;
14911503
CClientUIInterface* m_client_interface;
14921504
NetEventsInterface* m_msgproc;

0 commit comments

Comments
 (0)