diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-03-28 22:24:36 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-07-16 11:35:52 +0000 |
commit | 515ac2951d767bdb712c4997010045715902e6ab (patch) | |
tree | 5b35f3bb1781ffc1f1c50eef2de92629988c8747 /src/p2p/net_node.inl | |
parent | Merge pull request #5746 (diff) | |
download | monero-515ac2951d767bdb712c4997010045715902e6ab.tar.xz |
p2p: store network address directly in blocked host list
rather than their string representation
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index a5800df5e..37a3f393d 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -158,7 +158,7 @@ namespace nodetool bool node_server<t_payload_net_handler>::is_remote_host_allowed(const epee::net_utils::network_address &address) { CRITICAL_REGION_LOCAL(m_blocked_hosts_lock); - auto it = m_blocked_hosts.find(address.host_str()); + auto it = m_blocked_hosts.find(address); if(it == m_blocked_hosts.end()) return true; if(time(nullptr) >= it->second) @@ -184,7 +184,7 @@ namespace nodetool limit = std::numeric_limits<time_t>::max(); else limit = now + seconds; - m_blocked_hosts[addr.host_str()] = limit; + m_blocked_hosts[addr] = limit; // drop any connection to that address. This should only have to look into // the zone related to the connection, but really make sure everything is @@ -214,7 +214,7 @@ namespace nodetool bool node_server<t_payload_net_handler>::unblock_host(const epee::net_utils::network_address &address) { CRITICAL_REGION_LOCAL(m_blocked_hosts_lock); - auto i = m_blocked_hosts.find(address.host_str()); + auto i = m_blocked_hosts.find(address); if (i == m_blocked_hosts.end()) return false; m_blocked_hosts.erase(i); |