mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
tx: use elements_input_init_alloc
This commit is contained in:
parent
c6656dcbe8
commit
d1d96a9952
14
bitcoin/tx.c
14
bitcoin/tx.c
@ -193,14 +193,26 @@ int bitcoin_tx_add_input(struct bitcoin_tx *tx, const struct bitcoin_txid *txid,
|
||||
|
||||
assert(tx->wtx != NULL);
|
||||
i = tx->wtx->num_inputs;
|
||||
if (chainparams->is_elements)
|
||||
wally_err =
|
||||
wally_tx_elements_input_init_alloc(txid->shad.sha.u.u8,
|
||||
sizeof(struct bitcoin_txid),
|
||||
outnum, sequence,
|
||||
scriptSig, tal_bytelen(scriptSig),
|
||||
NULL /* Empty witness stack */,
|
||||
NULL, 0, NULL, 0,
|
||||
NULL, 0, NULL, 0,
|
||||
NULL, 0, NULL, 0,
|
||||
NULL, &input);
|
||||
else
|
||||
wally_err = wally_tx_input_init_alloc(txid->shad.sha.u.u8,
|
||||
sizeof(struct bitcoin_txid),
|
||||
outnum, sequence,
|
||||
scriptSig, tal_bytelen(scriptSig),
|
||||
NULL /* Empty witness stack */,
|
||||
&input);
|
||||
|
||||
assert(wally_err == WALLY_OK);
|
||||
input->features = chainparams->is_elements ? WALLY_TX_IS_ELEMENTS : 0;
|
||||
wally_tx_add_input(tx->wtx, input);
|
||||
psbt_add_input(tx->psbt, input, i);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user