mirror of
https://github.com/monero-project/monero.git
synced 2025-07-25 10:15:21 -04:00
Merge pull request #5019
65ce387c
daemon: add a +hex option to print_block (moneromooo-monero)
This commit is contained in:
commit
17878369f9
3 changed files with 23 additions and 7 deletions
|
@ -663,7 +663,7 @@ bool t_rpc_command_executor::print_height() {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool t_rpc_command_executor::print_block_by_hash(crypto::hash block_hash) {
|
||||
bool t_rpc_command_executor::print_block_by_hash(crypto::hash block_hash, bool include_hex) {
|
||||
cryptonote::COMMAND_RPC_GET_BLOCK::request req;
|
||||
cryptonote::COMMAND_RPC_GET_BLOCK::response res;
|
||||
epee::json_rpc::error error_resp;
|
||||
|
@ -689,13 +689,15 @@ bool t_rpc_command_executor::print_block_by_hash(crypto::hash block_hash) {
|
|||
}
|
||||
}
|
||||
|
||||
if (include_hex)
|
||||
tools::success_msg_writer() << res.blob << std::endl;
|
||||
print_block_header(res.block_header);
|
||||
tools::success_msg_writer() << res.json << ENDL;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool t_rpc_command_executor::print_block_by_height(uint64_t height) {
|
||||
bool t_rpc_command_executor::print_block_by_height(uint64_t height, bool include_hex) {
|
||||
cryptonote::COMMAND_RPC_GET_BLOCK::request req;
|
||||
cryptonote::COMMAND_RPC_GET_BLOCK::response res;
|
||||
epee::json_rpc::error error_resp;
|
||||
|
@ -721,6 +723,8 @@ bool t_rpc_command_executor::print_block_by_height(uint64_t height) {
|
|||
}
|
||||
}
|
||||
|
||||
if (include_hex)
|
||||
tools::success_msg_writer() << res.blob << std::endl;
|
||||
print_block_header(res.block_header);
|
||||
tools::success_msg_writer() << res.json << ENDL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue