mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-11-14 07:03:29 +01:00
daemon: print a decoded tx in print_tx
in addition to the raw hex representation
This commit is contained in:
parent
1d678b1ee2
commit
0822933524
@ -492,7 +492,25 @@ bool t_rpc_command_executor::print_transaction(crypto::hash transaction_hash) {
|
|||||||
|
|
||||||
if (1 == res.txs_as_hex.size())
|
if (1 == res.txs_as_hex.size())
|
||||||
{
|
{
|
||||||
|
// first as hex
|
||||||
tools::success_msg_writer() << res.txs_as_hex.front();
|
tools::success_msg_writer() << res.txs_as_hex.front();
|
||||||
|
|
||||||
|
// then as json
|
||||||
|
crypto::hash tx_hash, tx_prefix_hash;
|
||||||
|
cryptonote::transaction tx;
|
||||||
|
cryptonote::blobdata blob;
|
||||||
|
if (!string_tools::parse_hexstr_to_binbuff(res.txs_as_hex.front(), blob))
|
||||||
|
{
|
||||||
|
tools::fail_msg_writer() << "Failed to parse tx";
|
||||||
|
}
|
||||||
|
else if (!cryptonote::parse_and_validate_tx_from_blob(blob, tx, tx_hash, tx_prefix_hash))
|
||||||
|
{
|
||||||
|
tools::fail_msg_writer() << "Failed to parse tx blob";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tools::success_msg_writer() << cryptonote::obj_to_json_str(tx) << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user