mirror of
https://github.com/monero-project/monero.git
synced 2025-08-22 16:39:36 -04:00
p2p: close the right number of connections on setting max in/out peers
This commit is contained in:
parent
fcbf7b3f74
commit
098aadf084
2 changed files with 26 additions and 2 deletions
|
@ -2209,7 +2209,7 @@ namespace nodetool
|
|||
auto public_zone = m_network_zones.find(epee::net_utils::zone::public_);
|
||||
if (public_zone != m_network_zones.end())
|
||||
{
|
||||
const auto current = public_zone->second.m_config.m_net_config.max_out_connection_count;
|
||||
const auto current = public_zone->second.m_net_server.get_config_object().get_out_connections_count();
|
||||
public_zone->second.m_config.m_net_config.max_out_connection_count = count;
|
||||
if(current > count)
|
||||
public_zone->second.m_net_server.get_config_object().del_out_connections(current - count);
|
||||
|
@ -2223,7 +2223,7 @@ namespace nodetool
|
|||
auto public_zone = m_network_zones.find(epee::net_utils::zone::public_);
|
||||
if (public_zone != m_network_zones.end())
|
||||
{
|
||||
const auto current = public_zone->second.m_config.m_net_config.max_in_connection_count;
|
||||
const auto current = public_zone->second.m_net_server.get_config_object().get_in_connections_count();
|
||||
public_zone->second.m_config.m_net_config.max_in_connection_count = count;
|
||||
if(current > count)
|
||||
public_zone->second.m_net_server.get_config_object().del_in_connections(current - count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue