aboutsummaryrefslogtreecommitdiff
path: root/src/p2p/net_node.inl
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-09-16 19:20:23 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-09-16 22:45:45 +0000
commit7b076d5170f3299b1933f990e8b35777083c1809 (patch)
tree752ecbe4a7eb6d3717bad3f9189ba823a34092e3 /src/p2p/net_node.inl
parentMerge pull request #5861 (diff)
downloadmonero-7b076d5170f3299b1933f990e8b35777083c1809.tar.xz
p2p: fix bans taking port into account
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r--src/p2p/net_node.inl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 97a18b519..24c87cef8 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -166,7 +166,7 @@ namespace nodetool
const time_t now = time(nullptr);
// look in the hosts list
- auto it = m_blocked_hosts.find(address);
+ auto it = m_blocked_hosts.find(address.host_str());
if (it != m_blocked_hosts.end())
{
if (now >= it->second)
@@ -224,7 +224,7 @@ namespace nodetool
limit = std::numeric_limits<time_t>::max();
else
limit = now + seconds;
- m_blocked_hosts[addr] = limit;
+ m_blocked_hosts[addr.host_str()] = 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
@@ -254,7 +254,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);
+ auto i = m_blocked_hosts.find(address.host_str());
if (i == m_blocked_hosts.end())
return false;
m_blocked_hosts.erase(i);
@@ -1342,7 +1342,7 @@ namespace nodetool
bool node_server<t_payload_net_handler>::is_addr_recently_failed(const epee::net_utils::network_address& addr)
{
CRITICAL_REGION_LOCAL(m_conn_fails_cache_lock);
- auto it = m_conn_fails_cache.find(addr);
+ auto it = m_conn_fails_cache.find(addr.host_str());
if(it == m_conn_fails_cache.end())
return false;