diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-09-19 16:34:29 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2015-09-19 16:47:48 +0100 |
commit | e546f3724aeb91e72df263c27780a4d149b0a92a (patch) | |
tree | 76b560fca57fedc410af0d6e3cdec526fc8ed420 /src/daemon/command_parser_executor.cpp | |
parent | blockchain: force a hardfork recalculation at load time (diff) | |
download | monero-e546f3724aeb91e72df263c27780a4d149b0a92a.tar.xz |
Add an RPC call and daemon command to get info on hard fork voting
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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<std::string>& return m_executor.stop_save_graph(); } +bool t_command_parser_executor::hard_fork_info(const std::vector<std::string>& 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 |