Skip to content

Commit

Permalink
pytest: test that ignore-fee-limits doesn't apply for mutual close.
Browse files Browse the repository at this point in the history
Thought it's intuitive, it's not documented to, and LDK's current behavior makes it quite dangerous to do so.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed May 21, 2024
1 parent 425b3b0 commit 951688a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4044,6 +4044,23 @@ def test_closing_no_anysegwit_retry(node_factory, bitcoind):
l1.rpc.close(l2.info['id'], destination=oldaddr)


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

# l2's feerates go up. A lot!
l2.set_feerates((100000, 100000, 100000, 100000))
l2.restart()
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)

# This fails to negotiate.
executor.submit(l1.rpc.close, l2.info['id'])
l1.daemon.wait_for_log("Unable to agree on a feerate.")


@pytest.mark.parametrize("anchors", [False, True])
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd anchors not supportd')
def test_anchorspend_using_to_remote(node_factory, bitcoind, anchors):
Expand Down

0 comments on commit 951688a

Please sign in to comment.