add RPC calls and commands to get/set bans

This commit is contained in:
moneromooo-monero
2015-11-26 00:04:22 +00:00
parent 7bc4dce6ed
commit 38ceb73848
11 changed files with 302 additions and 4 deletions

View File

@@ -194,6 +194,21 @@ t_command_server::t_command_server(
, std::bind(&t_command_parser_executor::hard_fork_info, &m_parser, p::_1)
, "Print hard fork voting information"
);
m_command_lookup.set_handler(
"bans"
, std::bind(&t_command_parser_executor::show_bans, &m_parser, p::_1)
, "Show the currently banned IPs"
);
m_command_lookup.set_handler(
"ban"
, std::bind(&t_command_parser_executor::ban, &m_parser, p::_1)
, "Ban a given IP for a time"
);
m_command_lookup.set_handler(
"unban"
, std::bind(&t_command_parser_executor::unban, &m_parser, p::_1)
, "Unban a given IP"
);
}
bool t_command_server::process_command_str(const std::string& cmd)