diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-04-17 08:27:23 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-04-17 08:27:24 +0200 |
commit | 4609b36608a3103793c71bde6067d7f91421b560 (patch) | |
tree | 0edbbbd54bb2d5446f8444c66d00debed5f9a765 | |
parent | Merge pull request #5454 (diff) | |
parent | unit_tests: undo is_blocked implementation factoring (diff) | |
download | monero-4609b36608a3103793c71bde6067d7f91421b560.tar.xz |
Merge pull request #5455
e3dea478 unit_tests: undo is_blocked implementation factoring (moneromooo-monero)
-rw-r--r-- | tests/unit_tests/ban.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/unit_tests/ban.cpp b/tests/unit_tests/ban.cpp index c8ce19ba4..0b267172f 100644 --- a/tests/unit_tests/ban.cpp +++ b/tests/unit_tests/ban.cpp @@ -93,7 +93,18 @@ typedef nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<test_cor static bool is_blocked(Server &server, const epee::net_utils::network_address &address, time_t *t = NULL) { - return server.is_host_blocked(address.host_str(), t); + const std::string host = address.host_str(); + std::map<std::string, time_t> hosts = server.get_blocked_hosts(); + for (auto rec: hosts) + { + if (rec.first == host) + { + if (t) + *t = rec.second; + return true; + } + } + return false; } TEST(ban, add) |