mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 13:25:43 +01:00
psbt: use elements input init alloc
This commit is contained in:
parent
722fa1df6c
commit
c6656dcbe8
@ -112,18 +112,27 @@ struct wally_psbt_input *psbt_append_input(struct wally_psbt *psbt,
|
||||
{
|
||||
struct wally_tx_input *tx_in;
|
||||
struct wally_psbt_input *input;
|
||||
size_t insert_at;
|
||||
|
||||
insert_at = psbt->num_inputs;
|
||||
|
||||
if (chainparams->is_elements) {
|
||||
if (wally_tx_elements_input_init_alloc(txid->shad.sha.u.u8,
|
||||
sizeof(txid->shad.sha.u.u8),
|
||||
outnum, sequence, NULL, 0,
|
||||
NULL,
|
||||
NULL, 0,
|
||||
NULL, 0, NULL, 0,
|
||||
NULL, 0, NULL, 0,
|
||||
NULL, 0, NULL,
|
||||
&tx_in) != WALLY_OK)
|
||||
abort();
|
||||
} else {
|
||||
if (wally_tx_input_init_alloc(txid->shad.sha.u.u8,
|
||||
sizeof(struct bitcoin_txid),
|
||||
sizeof(txid->shad.sha.u.u8),
|
||||
outnum, sequence, NULL, 0, NULL,
|
||||
&tx_in) != WALLY_OK)
|
||||
abort();
|
||||
}
|
||||
|
||||
tx_in->features = chainparams->is_elements ? WALLY_TX_IS_ELEMENTS : 0;
|
||||
input = psbt_add_input(psbt, tx_in, insert_at);
|
||||
input = psbt_add_input(psbt, tx_in, psbt->num_inputs);
|
||||
wally_tx_input_free(tx_in);
|
||||
return input;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user