Skip to content

Commit e6b14da

Browse files
rustyrussellmadelinevibes
authored andcommitted
pytest: test for watchtime-blocks=0
It's not really advisable, but it's legal, though our HSMD refuses to sign off on operations. Signed-off-by: Rusty Russell <[email protected]>
1 parent a1c554f commit e6b14da

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_misc.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4972,3 +4972,18 @@ def test_tracing(node_factory):
49724972
assert res[0]['traceId'] == '00112233445566778899aabbccddeeff'
49734973
# Everyone has a parent!
49744974
assert 'parentId' in res[0]
4975+
4976+
4977+
@pytest.mark.xfail(strict=True)
4978+
def test_zero_locktime_blocks(node_factory, bitcoind):
4979+
"""Ensure our node "works" even if locktime set to 0."""
4980+
l1, l2, l3 = node_factory.line_graph(3, opts=[{}, {'watchtime-blocks': 0}, {}], wait_for_announce=True)
4981+
4982+
# We should be able to use the channel and close it.
4983+
inv = l3.rpc.invoice(10000, 'test_zero_locktime_blocks', 'test_zero_locktime_blocks')
4984+
l1.rpc.xpay(inv['bolt11'])
4985+
4986+
l1.rpc.close(l2.info['id'])
4987+
l2.rpc.close(l3.info['id'])
4988+
bitcoind.generate_block(1, wait_for_mempool=2)
4989+
sync_blockheight(bitcoind, [l1, l2, l3])

0 commit comments

Comments
 (0)