From 79c01c13865a4f8a8af5afbff7ad71a00f32eaed Mon Sep 17 00:00:00 2001 From: niftynei Date: Tue, 24 Nov 2020 19:50:21 -0600 Subject: [PATCH] feerates: mimic behavior of original opening if feerates not specified Setting to min is a premature optimization, at least until we're able to intelligently use anchors to sink commitment txs --- lightningd/dual_open_control.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lightningd/dual_open_control.c b/lightningd/dual_open_control.c index 07f5772fe..524849acd 100644 --- a/lightningd/dual_open_control.c +++ b/lightningd/dual_open_control.c @@ -1474,11 +1474,6 @@ static struct command_result *json_openchannel_init(struct command *cmd, type_to_string(tmpctx, struct wally_psbt, psbt)); fc->funding = *amount; - if (!feerate_per_kw) { - feerate_per_kw = tal(cmd, u32); - /* Anchors exist, set the commitment feerate to min */ - *feerate_per_kw = feerate_min(cmd->ld, NULL); - } if (!feerate_per_kw_funding) { feerate_per_kw_funding = tal(cmd, u32); *feerate_per_kw_funding = opening_feerate(cmd->ld->topology); @@ -1487,6 +1482,12 @@ static struct command_result *json_openchannel_init(struct command *cmd, "`funding_feerate` not specified and fee " "estimation failed"); } + if (!feerate_per_kw) { + feerate_per_kw = tal(cmd, u32); + /* FIXME: Anchors are on by default, we should use the lowest + * possible feerate */ + *feerate_per_kw = *feerate_per_kw_funding; + } if (!topology_synced(cmd->ld->topology)) { return command_fail(cmd, FUNDING_STILL_SYNCING_BITCOIN,