mirror of
https://github.com/monero-project/monero.git
synced 2026-01-07 10:50:36 -08:00
Merge pull request #5019
65ce387c daemon: add a +hex option to print_block (moneromooo-monero)
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user