aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/rpc_command_executor.cpp
diff options
context:
space:
mode:
authorsumogr <sumogr@mail.com>2020-02-24 18:12:04 +0000
committersumogr <sumogr@mail.com>2020-02-24 20:52:55 +0000
commit6810150d463f1a7daf2dea2f2e5faf52951f38e4 (patch)
treef6ee1b5e886e7163cb2bde421f054fd7e3a4baad /src/daemon/rpc_command_executor.cpp
parentMerge pull request #6198 (diff)
downloadmonero-6810150d463f1a7daf2dea2f2e5faf52951f38e4.tar.xz
daemon: if no banned IPs print something
Diffstat (limited to '')
-rw-r--r--src/daemon/rpc_command_executor.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 1ca728e39..f2c7244a3 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -1699,15 +1699,19 @@ bool t_rpc_command_executor::print_bans()
}
}
- for (auto i = res.bans.begin(); i != res.bans.end(); ++i)
+ if (!res.bans.empty())
{
- tools::msg_writer() << i->host << " banned for " << i->seconds << " seconds";
+ for (auto i = res.bans.begin(); i != res.bans.end(); ++i)
+ {
+ tools::msg_writer() << i->host << " banned for " << i->seconds << " seconds";
+ }
}
+ else
+ tools::msg_writer() << "No IPs are banned";
return true;
}
-
bool t_rpc_command_executor::ban(const std::string &address, time_t seconds)
{
cryptonote::COMMAND_RPC_SETBANS::request req;