aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-16 22:23:15 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-04-16 22:23:15 +0000
commite3dea478594a202e2d90826c768a23c3d5b95f57 (patch)
treef7703c9f0fd02de977711d8ce6c04ebc728e0e1c /tests
parentMerge pull request #5430 (diff)
downloadmonero-e3dea478594a202e2d90826c768a23c3d5b95f57.tar.xz
unit_tests: undo is_blocked implementation factoring
The is_host_blocked method is not on master yet
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/ban.cpp13
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)