rpc: add a command to get info about the current blockchain

About the tip of the main chain, and the last N blocks
This commit is contained in:
moneromooo-monero
2017-01-08 11:14:11 +00:00
parent 2806842200
commit 5b5017e267
7 changed files with 134 additions and 1 deletions

View File

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