Skip to content

Commit 877df5a

Browse files
rustyrussellendothermicdev
authored andcommitted
lightningd: don't ignore fee limits on mutual close.
LDK will pick the *upper* limit (see: lightningdevkit/rust-lightning#3014)! It should not do this, but since you can set a manual range for mutual close, it's probably better to disable this option for close, as it's even more dangerous than documented. Changelog-Changed: config/JSON: --ignore-fee-limits / setchannel ignorefeelimits no longer applies to mutual close. Signed-off-by: Rusty Russell <[email protected]> Fixes: #7242
1 parent 9556fa5 commit 877df5a

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

lightningd/closing_control.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,6 @@ void peer_start_closingd(struct channel *channel, struct peer_fd *peer_fd)
434434
if (channel->closing_feerate_range) {
435435
min_feerate = channel->closing_feerate_range[0];
436436
max_feerate = channel->closing_feerate_range[1];
437-
} else if (channel->ignore_fee_limits || ld->config.ignore_fee_limits) {
438-
min_feerate = 253;
439-
max_feerate = 0xFFFFFFFF;
440437
}
441438

442439
/* BOLT #3:

tests/test_closing.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4044,7 +4044,6 @@ def test_closing_no_anysegwit_retry(node_factory, bitcoind):
40444044
l1.rpc.close(l2.info['id'], destination=oldaddr)
40454045

40464046

4047-
@pytest.mark.xfail(strict=True)
40484047
def test_closing_ignore_fee_limits(node_factory, bitcoind, executor):
40494048
"""Don't use ignore-fee-limits on mutual close: LDK takes us to the cleaners if we do!"""
40504049
l1, l2 = node_factory.line_graph(2, opts=[{'may_reconnect': True,

tests/test_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,12 +2491,13 @@ def test_fee_limits(node_factory, bitcoind):
24912491
wait_for(lambda: only_one(l2.rpc.listpeerchannels()['channels'])['feerate']['perkw'] == fee)
24922492
assert only_one(l2.rpc.listpeerchannels()['channels'])['peer_connected'] is True
24932493

2494-
l1.rpc.close(l2.info['id'])
2494+
# This will fail to mutual close, since l2 won't ignore insane *close* fees!
2495+
assert l1.rpc.close(l2.info['id'], unilateraltimeout=5)['type'] == 'unilateral'
24952496

24962497
# Make sure the resolution of this one doesn't interfere with the next!
24972498
# Note: may succeed, may fail with insufficient fee, depending on how
24982499
# bitcoind feels!
2499-
l2.daemon.wait_for_log('sendrawtx exit')
2500+
l1.daemon.wait_for_log('sendrawtx exit')
25002501
bitcoind.generate_block(1)
25012502
sync_blockheight(bitcoind, [l1, l2])
25022503

@@ -2530,7 +2531,6 @@ def test_fee_limits(node_factory, bitcoind):
25302531
# 15sat/byte fee
25312532
l1.daemon.wait_for_log('peer_out WIRE_REVOKE_AND_ACK')
25322533

2533-
# This should wait for close to complete
25342534
l1.rpc.close(chan)
25352535

25362536

0 commit comments

Comments
 (0)