mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
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
This commit is contained in:
committed by
Christian Decker
parent
d47992a46d
commit
79c01c1386
@@ -1474,11 +1474,6 @@ static struct command_result *json_openchannel_init(struct command *cmd,
|
|||||||
type_to_string(tmpctx, struct wally_psbt, psbt));
|
type_to_string(tmpctx, struct wally_psbt, psbt));
|
||||||
|
|
||||||
fc->funding = *amount;
|
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) {
|
if (!feerate_per_kw_funding) {
|
||||||
feerate_per_kw_funding = tal(cmd, u32);
|
feerate_per_kw_funding = tal(cmd, u32);
|
||||||
*feerate_per_kw_funding = opening_feerate(cmd->ld->topology);
|
*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 "
|
"`funding_feerate` not specified and fee "
|
||||||
"estimation failed");
|
"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)) {
|
if (!topology_synced(cmd->ld->topology)) {
|
||||||
return command_fail(cmd, FUNDING_STILL_SYNCING_BITCOIN,
|
return command_fail(cmd, FUNDING_STILL_SYNCING_BITCOIN,
|
||||||
|
|||||||
Reference in New Issue
Block a user