lightningd: clarify uses of dynamic (mempool) feerate floor, and static.

We have the FEERATE_FLOOR constant if you don't care, but usually you want
to use the current bitcoind lower limit, so call get_feerate_floor()
(which is currently the same, but coming!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-04-07 14:09:53 +09:30
parent 7aa8c76002
commit faae44713b
8 changed files with 29 additions and 12 deletions

View File

@@ -703,12 +703,13 @@ static struct bitcoin_tx *onchaind_tx(const tal_t *ctx,
if (amount_sat_less(out_sats, min_out)) {
/* FIXME: We should use SIGHASH_NONE so others can take it? */
fee = amount_tx_fee(feerate_floor(), weight);
/* Use lowest possible theoretical fee: who cares if it doesn't propagate */
fee = amount_tx_fee(FEERATE_FLOOR, weight);
*worthwhile = false;
} else
*worthwhile = true;
/* This can only happen if feerate_floor() is still too high; shouldn't
/* This can only happen if FEERATE_FLOOR is still too high; shouldn't
* happen! */
if (!amount_sat_sub(&amt, out_sats, fee)) {
amt = channel->our_config.dust_limit;