Merge pull request #6096

a633f85d daemon: allow printing N blocks from the end of the chain (moneromooo-monero)
This commit is contained in:
Alexander Blair
2020-02-06 00:31:50 -08:00
3 changed files with 43 additions and 4 deletions

View File

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