mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-07 15:14:21 +01:00
wallet: fix psbt_using_utxos when used with base PSBT.
We were setting the wrong input number: don't assume it's the same as the UTXO number, but simply the last-appended input. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -314,7 +314,8 @@ struct wally_psbt *psbt_using_utxos(const tal_t *ctx,
|
||||
this_nsequence, scriptSig,
|
||||
NULL, redeemscript);
|
||||
|
||||
psbt_input_set_wit_utxo(psbt, i, scriptPubkey, utxos[i]->amount);
|
||||
psbt_input_set_wit_utxo(psbt, psbt->num_inputs-1,
|
||||
scriptPubkey, utxos[i]->amount);
|
||||
if (is_elements(chainparams)) {
|
||||
/* FIXME: persist asset tags */
|
||||
amount_sat_to_asset(&utxos[i]->amount,
|
||||
@@ -334,7 +335,7 @@ struct wally_psbt *psbt_using_utxos(const tal_t *ctx,
|
||||
tx = wallet_transaction_get(ctx, wallet,
|
||||
&utxos[i]->outpoint.txid);
|
||||
if (tx)
|
||||
psbt_input_set_utxo(psbt, i, tx->wtx);
|
||||
psbt_input_set_utxo(psbt, psbt->num_inputs-1, tx->wtx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user