lightningd: use lowball feerate for commit_tx on anchor channels.

Since we can CPFP, we don't have to track the feerate as closely.  But
it still needs to get in the mempool, so we use 10 sat/byte, or the
100 block estimate if that is higher.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `feerates` has new fields `unilateral_anchor_close` to show the feerate used for anchor channels (currently experimental), and `unilateral_close_nonanchor_satoshis`.
Changelog-Changed: JSON-RPC: `feerates` `unilateral_close_satoshis` now assumes anchor channels if enabled (currently experimental).
This commit is contained in:
Rusty Russell
2023-06-26 08:40:21 +09:30
parent dd76d60b0d
commit e45bf14300
15 changed files with 199 additions and 99 deletions

View File

@@ -68,7 +68,11 @@ static struct command_result *param_feerate_unchecked(struct command *cmd,
return NULL;
}
if (json_tok_streq(buffer, tok, "unilateral_close")) {
**feerate = unilateral_feerate(cmd->ld->topology);
**feerate = unilateral_feerate(cmd->ld->topology, false);
return NULL;
}
if (json_tok_streq(buffer, tok, "unilateral_anchor_close")) {
**feerate = unilateral_feerate(cmd->ld->topology, true);
return NULL;
}