From e546f3724aeb91e72df263c27780a4d149b0a92a Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 19 Sep 2015 16:34:29 +0100 Subject: Add an RPC call and daemon command to get info on hard fork voting --- src/daemon/command_parser_executor.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/daemon/command_parser_executor.cpp') diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index e6666c443..7b0f4a66b 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -361,5 +361,27 @@ bool t_command_parser_executor::stop_save_graph(const std::vector& return m_executor.stop_save_graph(); } +bool t_command_parser_executor::hard_fork_info(const std::vector& args) +{ + int version; + if (args.size() == 0) { + version = 0; + } + else if (args.size() == 1) { + try { + version = std::stoi(args[0]); + } + catch(std::invalid_argument& ex) { + return false; + } + if (version <= 0 || version > 255) + return false; + } + else { + return false; + } + return m_executor.hard_fork_info(version); +} + } // namespace daemonize -- cgit v1.2.3