aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/command_parser_executor.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-09-22 14:49:22 +0200
committerRiccardo Spagni <ric@spagni.net>2015-09-22 14:49:25 +0200
commit0193bfce4bcee87f202ac1154f017d57bb5aa08d (patch)
tree8f6b2d879f7e8b5c224a4592373bd37afc2a9957 /src/daemon/command_parser_executor.cpp
parentcf88e4dd24edab449765e78b34ec530f08373b68 (diff)
parent5b11a89a76cf44c0fb98d98b05eb1c9e4ddce0c4 (diff)
downloadmonzero-core-0193bfce4bcee87f202ac1154f017d57bb5aa08d.tar.gz
monzero-core-0193bfce4bcee87f202ac1154f017d57bb5aa08d.tar.xz
monzero-core-0193bfce4bcee87f202ac1154f017d57bb5aa08d.zip
Merge pull request #405
5b11a89 hardfork: most state now saved to the DB (moneromooo-monero) 0a54c3a hardfork: remove the "parts are copyright cryptonote" notices (moneromooo-monero) e546f37 Add an RPC call and daemon command to get info on hard fork voting (moneromooo-monero) d067131 blockchain: force a hardfork recalculation at load time (moneromooo-monero) a717761 core: add consts where appropriate (moneromooo-monero) 8ffc508 core: moan when we think an update is needed to get latest hard fork info (moneromooo-monero) f854984 blockchain: use the new hardfork class (moneromooo-monero) 62b1f74 New hardfork class (moneromooo-monero) bed9a44 blockchain: add a couple missing includes (moneromooo-monero)
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
-rw-r--r--src/daemon/command_parser_executor.cpp22
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