lightningd: don't make htlc_timeout_satoshis/htlc_success_satoshis zero if we support anchors.

It depends on whether we negotiated anchors: just document that this
field doesn't apply for anchors (it becomes zero by the end of this
patch series, which is weird).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-06-26 08:32:21 +09:30
parent 47fd31e8b4
commit e47e51edf2
3 changed files with 7 additions and 14 deletions

View File

@@ -701,11 +701,6 @@ static struct command_result *json_feerates(struct command *cmd,
json_object_end(response);
if (!missing) {
/* It actually is negotiated per-channel... */
bool anchor_outputs
= feature_offered(cmd->ld->our_features->bits[INIT_FEATURE],
OPT_ANCHOR_OUTPUTS);
json_object_start(response, "onchain_fee_estimates");
/* eg 020000000001016f51de645a47baa49a636b8ec974c28bdff0ac9151c0f4eda2dbe3b41dbe711d000000001716001401fad90abcd66697e2592164722de4a95ebee165ffffffff0240420f00000000002200205b8cd3b914cf67cdd8fa6273c930353dd36476734fbd962102c2df53b90880cdb73f890000000000160014c2ccab171c2a5be9dab52ec41b825863024c54660248304502210088f65e054dbc2d8f679de3e40150069854863efa4a45103b2bb63d060322f94702200d3ae8923924a458cffb0b7360179790830027bb6b29715ba03e12fc22365de1012103d745445c9362665f22e0d96e9e766f273f3260dea39c8a76bfa05dd2684ddccf00000000 == weight 702 */
json_add_num(response, "opening_channel_satoshis",
@@ -717,14 +712,12 @@ static struct command_result *json_feerates(struct command *cmd,
json_add_u64(response, "unilateral_close_satoshis",
unilateral_feerate(cmd->ld->topology) * 598 / 1000);
/* This really depends on whether we *negotiated*
* option_anchor_outputs for a particular channel! */
json_add_u64(response, "htlc_timeout_satoshis",
htlc_timeout_fee(htlc_resolution_feerate(cmd->ld->topology),
anchor_outputs).satoshis /* Raw: estimate */);
false).satoshis /* Raw: estimate */);
json_add_u64(response, "htlc_success_satoshis",
htlc_success_fee(htlc_resolution_feerate(cmd->ld->topology),
anchor_outputs).satoshis /* Raw: estimate */);
false).satoshis /* Raw: estimate */);
json_object_end(response);
}