aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-04-04 12:56:36 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-04-04 12:56:36 -0500
commit6a6eedd84241cc92ad09e72ced298275bd531c64 (patch)
tree2a7b3aa80864395005425bca2a7ad33bb0bc0119
parentMerge pull request #6351 (diff)
parentdaemon: if no banned IPs print something (diff)
downloadmonero-6a6eedd84241cc92ad09e72ced298275bd531c64.tar.xz
Merge pull request #6353
6810150 daemon: if no banned IPs print something (sumogr)
-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 086808f8e..80b14d534 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;