diff options
author | Alexander Blair <snipa@jagtech.io> | 2020-02-06 00:31:50 -0800 |
---|---|---|
committer | Alexander Blair <snipa@jagtech.io> | 2020-02-06 00:31:50 -0800 |
commit | 8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7 (patch) | |
tree | 701ae6b1f1e16455e88daf53fe0d930e4822d126 /src/daemon/command_parser_executor.cpp | |
parent | Merge pull request #6095 (diff) | |
parent | daemon: allow printing N blocks from the end of the chain (diff) | |
download | monero-8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7.tar.xz |
Merge pull request #6096
a633f85d daemon: allow printing N blocks from the end of the chain (moneromooo-monero)
Diffstat (limited to 'src/daemon/command_parser_executor.cpp')
-rw-r--r-- | src/daemon/command_parser_executor.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/daemon/command_parser_executor.cpp b/src/daemon/command_parser_executor.cpp index c11c7707a..ed6d3af01 100644 --- a/src/daemon/command_parser_executor.cpp +++ b/src/daemon/command_parser_executor.cpp @@ -153,6 +153,16 @@ bool t_command_parser_executor::print_blockchain_info(const std::vector<std::str } uint64_t start_index = 0; uint64_t end_index = 0; + if (args[0][0] == '-') + { + int64_t nblocks; + if(!epee::string_tools::get_xtype_from_string(nblocks, args[0])) + { + std::cout << "wrong number of blocks" << std::endl; + return false; + } + return m_executor.print_blockchain_info(nblocks, (uint64_t)-nblocks); + } if(!epee::string_tools::get_xtype_from_string(start_index, args[0])) { std::cout << "wrong starter block index parameter" << std::endl; |