From 515ac2951d767bdb712c4997010045715902e6ab Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Thu, 28 Mar 2019 22:24:36 +0000 Subject: p2p: store network address directly in blocked host list rather than their string representation --- src/rpc/core_rpc_server.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/rpc') diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index b6836e636..5fbdcde39 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -1772,15 +1772,15 @@ namespace cryptonote PERF_TIMER(on_get_bans); auto now = time(nullptr); - std::map blocked_hosts = m_p2p.get_blocked_hosts(); - for (std::map::const_iterator i = blocked_hosts.begin(); i != blocked_hosts.end(); ++i) + std::map blocked_hosts = m_p2p.get_blocked_hosts(); + for (std::map::const_iterator i = blocked_hosts.begin(); i != blocked_hosts.end(); ++i) { if (i->second > now) { COMMAND_RPC_GETBANS::ban b; - b.host = i->first; + b.host = i->first.host_str(); b.ip = 0; uint32_t ip; - if (epee::string_tools::get_ip_int32_from_string(ip, i->first)) + if (epee::string_tools::get_ip_int32_from_string(ip, b.host)) b.ip = ip; b.seconds = i->second - now; res.bans.push_back(b); -- cgit v1.2.3