Browse Source

psbt: save the index of the change on the 'parent'

Note that for removals, the index will be on the original; for
additions, the index will be on the new. Yes this is implicit.
travis-experimental
niftynei 4 years ago
committed by Rusty Russell
parent
commit
9d412718df
  1. 1
      common/psbt_open.c
  2. 4
      common/psbt_open.h

1
common/psbt_open.c

@ -219,6 +219,7 @@ void psbt_sort_by_serial_id(struct wally_psbt *psbt)
struct type##_set a; \
a.type = from->type##s[index]; \
a.tx_##type = from->tx->type##s[index]; \
a.idx = index; \
tal_arr_expand(&add_to, a); \
} while (0)

4
common/psbt_open.h

@ -19,11 +19,15 @@ struct wally_map;
struct input_set {
struct wally_tx_input tx_input;
struct wally_psbt_input input;
/* index on PSBT of this input */
size_t idx;
};
struct output_set {
struct wally_tx_output tx_output;
struct wally_psbt_output output;
/* index on PSBT of this output */
size_t idx;
};
struct psbt_changeset {

Loading…
Cancel
Save