Browse Source

wallet: show input txid in little endian for json_listtransactions

Changelog-Fixed: jsonrpc: `listtransactions` now displays all txids as little endian

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
nifty/pset-pre
Antoine Poinsot 5 years ago
committed by Christian Decker
parent
commit
5dfd2436db
  1. 1
      tests/test_misc.py
  2. 5
      wallet/walletrpc.c

1
tests/test_misc.py

@ -2390,7 +2390,6 @@ def test_commitfee_option(node_factory):
assert l1_commit_fees == 2 * l2_commit_fees == 2 * 4 * mock_wu # WU->VB
@pytest.mark.xfail(strict=True)
def test_listtransactions(node_factory):
"""Sanity check for the listtransactions RPC command"""
l1, l2 = node_factory.get_nodes(2, opts=[{}, {}])

5
wallet/walletrpc.c

@ -1035,9 +1035,12 @@ static void json_transaction_details(struct json_stream *response,
json_array_start(response, "inputs");
for (size_t i = 0; i < wtx->num_inputs; i++) {
struct bitcoin_txid prevtxid;
struct wally_tx_input *in = &wtx->inputs[i];
bitcoin_tx_input_get_txid(tx->tx, i, &prevtxid);
json_object_start(response, NULL);
json_add_hex(response, "txid", in->txhash, sizeof(in->txhash));
json_add_txid(response, "txid", &prevtxid);
json_add_u32(response, "index", in->index);
json_add_u32(response, "sequence", in->sequence);
#if EXPERIMENTAL_FEATURES

Loading…
Cancel
Save