diff --git a/wallet/reservation.c b/wallet/reservation.c index 4d3b470df..e04a4cd2d 100644 --- a/wallet/reservation.c +++ b/wallet/reservation.c @@ -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); } }