wallet: generalize wallet_utxo_boost.

We use this for anchors, in which case we have a minimum value for
change.  If we don't take this into account, we end up with a lower
feerate once we actually create the tx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-05-06 05:25:46 +09:30
parent a8f75cca28
commit 65a145f1d9
4 changed files with 52 additions and 19 deletions

View File

@@ -1091,9 +1091,10 @@ static bool consider_onchain_htlc_tx_rebroadcast(struct channel *channel,
utxos = wallet_utxo_boost(tmpctx,
ld->wallet,
get_block_height(ld->topology),
AMOUNT_SAT(0),
bitcoin_tx_compute_fee(newtx),
feerate,
&weight);
&weight, NULL);
/* Add those to create a new PSBT */
psbt = psbt_using_utxos(tmpctx, ld->wallet, utxos, locktime,