Add an RPC call and daemon command to get info on hard fork voting

This commit is contained in:
moneromooo-monero
2015-09-19 16:34:29 +01:00
parent d06713199e
commit e546f3724a
13 changed files with 169 additions and 5 deletions

View File

@@ -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