diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-08 11:14:11 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2017-01-13 23:21:38 +0000 |
commit | 5b5017e26708c48cc1ba7bd3f1e0f0f70d6c6316 (patch) | |
tree | 6560c7f8c0177766d1ae0d276bd7de0742972211 /src/daemon/command_parser_executor.cpp | |
parent | Merge pull request #1562 (diff) | |
download | monero-5b5017e26708c48cc1ba7bd3f1e0f0f70d6c6316.tar.xz |
rpc: add a command to get info about the current blockchain
About the tip of the main chain, and the last N blocks
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index 7381dd06f..9d28cd41e 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -511,4 +511,22 @@ bool t_command_parser_executor::alt_chain_info(const std::vector<std::string>& a return m_executor.alt_chain_info(); } +bool t_command_parser_executor::print_blockchain_dynamic_stats(const std::vector<std::string>& args) +{ + if(args.size() != 1) + { + std::cout << "Exactly one parameter is needed" << std::endl; + return false; + } + + uint64_t nblocks = 0; + if(!epee::string_tools::get_xtype_from_string(nblocks, args[0]) || nblocks == 0) + { + std::cout << "wrong number of blocks" << std::endl; + return false; + } + + return m_executor.print_blockchain_dynamic_stats(nblocks); +} + } // namespace daemonize |