diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-10-11 10:30:45 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2021-02-15 19:08:07 +0000 |
commit | d643a865f38fd8f5c6d8dd06bfb99c33eef3f5fd (patch) | |
tree | 78a66616cb00b2c4f5b3543839a05dd86b2c04bd /src/p2p/net_node.inl | |
parent | Merge pull request #6900 (diff) | |
download | monero-d643a865f38fd8f5c6d8dd06bfb99c33eef3f5fd.tar.xz |
p2p: add --max-connections-per-ip daemon option
Helps daemons behind a proxy get more than one connection.
Defaults to 1 (no change)
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 05af22a7f..63ac2f1bd 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -131,6 +131,7 @@ namespace nodetool command_line::add_arg(desc, arg_limit_rate_down); command_line::add_arg(desc, arg_limit_rate); command_line::add_arg(desc, arg_pad_transactions); + command_line::add_arg(desc, arg_max_connections_per_ip); } //----------------------------------------------------------------------------------- template<class t_payload_net_handler> @@ -615,6 +616,8 @@ namespace nodetool return false; } + max_connections = command_line::get_arg(vm, arg_max_connections_per_ip); + return true; } //----------------------------------------------------------------------------------- @@ -2846,8 +2849,7 @@ namespace nodetool if (address.get_zone() != epee::net_utils::zone::public_) return false; // Unable to determine how many connections from host - const size_t max_connections = 1; - size_t count = 0; + uint32_t count = 0; m_network_zones.at(epee::net_utils::zone::public_).m_net_server.get_config_object().foreach_connection([&](const p2p_connection_context& cntxt) { |