diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 3ce4e6006..d9419b2bc 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -950,13 +950,16 @@ namespace cryptonote return false; } + auto now = time(nullptr); std::map blocked_ips = m_p2p.get_blocked_ips(); for (std::map::const_iterator i = blocked_ips.begin(); i != blocked_ips.end(); ++i) { - COMMAND_RPC_GETBANS::ban b; - b.ip = i->first; - b.seconds = i->second; - res.bans.push_back(b); + if (i->second > now) { + COMMAND_RPC_GETBANS::ban b; + b.ip = i->first; + b.seconds = i->second - now; + res.bans.push_back(b); + } } res.status = CORE_RPC_STATUS_OK;