Skip to content

Commit c7da7ca

Browse files
committed
feerates: de-dupe min_ max_ printing twice when feerates called
We want to compare to `i`, the enum counter, not feerates[i], the feerate value. Without this fix, `feerates` appears as: ``` { "perkw": { "opening": 253, "mutual_close": 253, "unilateral_close": 253, "delayed_to_us": 253, "htlc_resolution": 253, "penalty": 253, "min_acceptable": 253, "max_acceptable": 2500, "min_acceptable": 253, "max_acceptable": 4294967295, "urgent": 253, "normal": 253, "slow": 506 }, "onchain_fee_estimates": { "opening_channel_satoshis": 177, "mutual_close_satoshis": 170, "unilateral_close_satoshis": 151, "htlc_timeout_satoshis": 167, "htlc_success_satoshis": 177 } } ``` bug introduced in "chaintopology: better feerate targets differentiation"
1 parent fc86720 commit c7da7ca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lightningd/chaintopology.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,7 @@ static struct command_result *json_feerates(struct command *cmd,
516516
response = json_stream_success(cmd);
517517
json_object_start(response, json_feerate_style_name(*style));
518518
for (size_t i = 0; i < ARRAY_SIZE(feerates); i++) {
519-
if (!feerates[i] || feerates[i] == FEERATE_MIN
520-
|| feerates[i] == FEERATE_MAX)
519+
if (!feerates[i] || i == FEERATE_MIN || i == FEERATE_MAX)
521520
continue;
522521
json_add_num(response, feerate_name(i),
523522
feerate_to_style(feerates[i], *style));

0 commit comments

Comments
 (0)