p2p: only try to connect to IPv6 addresses if using --p2p-use-ipv6
This commit is contained in:
parent
964ad0e51a
commit
70e62a029c
@ -1352,6 +1352,9 @@ namespace nodetool
|
||||
}
|
||||
|
||||
|
||||
if (!m_use_ipv6 && na.get_type_id() == epee::net_utils::ipv6_network_address::get_type_id())
|
||||
return false;
|
||||
|
||||
MDEBUG("Connecting to " << na.str() << "(peer_type=" << peer_type << ", last_seen: "
|
||||
<< (last_seen_stamp ? epee::misc_utils::get_time_interval_string(time(NULL) - last_seen_stamp):"never")
|
||||
<< ")...");
|
||||
@ -1596,6 +1599,9 @@ namespace nodetool
|
||||
}
|
||||
}
|
||||
|
||||
if (!skip && !m_use_ipv6 && pe.adr.get_type_id() == epee::net_utils::ipv6_network_address::get_type_id())
|
||||
skip = true;
|
||||
|
||||
// consider each host once, to avoid giving undue inflence to hosts running several nodes
|
||||
if (!skip)
|
||||
{
|
||||
@ -2876,6 +2882,8 @@ namespace nodetool
|
||||
peerlist_entry pe{};
|
||||
if (!zone.second.m_peerlist.get_random_gray_peer(pe))
|
||||
continue;
|
||||
if (!m_use_ipv6 && pe.adr.get_type_id() == epee::net_utils::ipv6_network_address::get_type_id())
|
||||
continue;
|
||||
|
||||
if (!check_connection_and_handshake_with_peer(pe.adr, pe.last_seen))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user