aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-07-20 13:53:25 +0200
committerRiccardo Spagni <ric@spagni.net>2016-07-20 13:53:25 +0200
commitb1bec02ce51301a59185fd856c7d85208cbcc422 (patch)
treea312b84b85877a2bb99f1e8c690ffc69187d5229
parentMerge pull request #899 (diff)
parentdaemon: fix ban seconds being misinterpreted as absolute (diff)
downloadmonero-b1bec02ce51301a59185fd856c7d85208cbcc422.tar.xz
Merge pull request #900
78cc10f daemon: fix ban seconds being misinterpreted as absolute (moneromooo-monero) 34ecfdb rpc: fix get_bans and set_bans RPC names, they were missing a _ (moneromooo-monero)
-rw-r--r--src/daemon/rpc_command_executor.cpp4
-rw-r--r--src/rpc/core_rpc_server.h4
2 files changed, 3 insertions, 5 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index ae9492111..0a0fc793d 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -1123,11 +1123,9 @@ bool t_rpc_command_executor::print_bans()
}
}
- time_t now = time(nullptr);
for (auto i = res.bans.begin(); i != res.bans.end(); ++i)
{
- time_t seconds = i->seconds - now;
- tools::msg_writer() << epee::string_tools::get_ip_string_from_int32(i->ip) << " banned for " << seconds << " seconds";
+ tools::msg_writer() << epee::string_tools::get_ip_string_from_int32(i->ip) << " banned for " << i->seconds << " seconds";
}
return true;
diff --git a/src/rpc/core_rpc_server.h b/src/rpc/core_rpc_server.h
index a7a54b59f..2d936df51 100644
--- a/src/rpc/core_rpc_server.h
+++ b/src/rpc/core_rpc_server.h
@@ -107,8 +107,8 @@ namespace cryptonote
MAP_JON_RPC_WE_IF("get_connections", on_get_connections, COMMAND_RPC_GET_CONNECTIONS, !m_restricted)
MAP_JON_RPC_WE("get_info", on_get_info_json, COMMAND_RPC_GET_INFO)
MAP_JON_RPC_WE("hard_fork_info", on_hard_fork_info, COMMAND_RPC_HARD_FORK_INFO)
- MAP_JON_RPC_WE_IF("setbans", on_set_bans, COMMAND_RPC_SETBANS, !m_restricted)
- MAP_JON_RPC_WE_IF("getbans", on_get_bans, COMMAND_RPC_GETBANS, !m_restricted)
+ MAP_JON_RPC_WE_IF("set_bans", on_set_bans, COMMAND_RPC_SETBANS, !m_restricted)
+ MAP_JON_RPC_WE_IF("get_bans", on_get_bans, COMMAND_RPC_GETBANS, !m_restricted)
MAP_JON_RPC_WE_IF("flush_txpool", on_flush_txpool, COMMAND_RPC_FLUSH_TRANSACTION_POOL, !m_restricted)
MAP_JON_RPC_WE("get_output_histogram", on_get_output_histogram, COMMAND_RPC_GET_OUTPUT_HISTOGRAM)
END_JSON_RPC_MAP()