mirror of
https://github.com/wownero/wownero.git
synced 2026-11-13 11:53:55 +01:00
p2p: close the right number of connections on setting max in/out peers
This commit is contained in:
@@ -2207,7 +2207,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);
|
||||
@@ -2220,7 +2220,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);
|
||||
|
||||
Reference in New Issue
Block a user