diff options
-rw-r--r-- | src/daemon/main.cpp | 6 | ||||
-rw-r--r-- | tests/unit_tests/ban.cpp | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index 9e1c86b91..dbbb2308c 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -257,11 +257,7 @@ int main(int argc, char const * argv[]) bf::path log_file_path {data_dir / std::string(CRYPTONOTE_NAME ".log")}; if (!command_line::is_arg_defaulted(vm, daemon_args::arg_log_file)) log_file_path = command_line::get_arg(vm, daemon_args::arg_log_file); -#ifdef __WIN32 - if (!strchr(log_file_path.c_str(), '/') && !strchr(log_file_path.c_str(), '\\')) -#else - if (!strchr(log_file_path.c_str(), '/')) -#endif + if (!log_file_path.has_parent_path()) log_file_path = bf::absolute(log_file_path, relative_path_base); mlog_configure(log_file_path.string(), true, command_line::get_arg(vm, daemon_args::arg_max_log_file_size), command_line::get_arg(vm, daemon_args::arg_max_log_files)); 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) |