Skip to content

Commit

Permalink
wallet: show input txid in little endian for json_listtransactions
Browse files Browse the repository at this point in the history
Changelog-Fixed: jsonrpc: `listtransactions` now displays all txids as little endian

Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
  • Loading branch information
darosior authored and cdecker committed May 22, 2020
1 parent 1061cd9 commit 5dfd243
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[{}, {}])
Expand Down
5 changes: 4 additions & 1 deletion wallet/walletrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5dfd243

Please sign in to comment.