Skip to content

Commit 54a187c

Browse files
committed
pytest: test for bcli crash with huge PSBTs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 8f0a518 commit 54a187c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_plugin.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,22 @@ def test_bitcoin_backend(node_factory, bitcoind):
18751875
" bitcoind")
18761876

18771877

1878+
@pytest.mark.xfail(strict=True)
1879+
def test_bitcoin_backend_gianttx(node_factory, bitcoind):
1880+
"""Test that a giant tx doesn't crash bcli"""
1881+
l1 = node_factory.get_node(start=False)
1882+
# With memleak we spend far too much time gathering backtraces.
1883+
del l1.daemon.env["LIGHTNINGD_DEV_MEMLEAK"]
1884+
l1.start()
1885+
addrs = {addr: 0.00200000 for addr in [l1.rpc.newaddr('bech32')['bech32'] for _ in range(700)]}
1886+
bitcoind.rpc.sendmany("", addrs)
1887+
bitcoind.generate_block(1, wait_for_mempool=1)
1888+
sync_blockheight(bitcoind, [l1])
1889+
1890+
l1.rpc.withdraw(bitcoind.rpc.getnewaddress(), 'all')
1891+
bitcoind.generate_block(1, wait_for_mempool=1)
1892+
1893+
18781894
def test_bitcoin_bad_estimatefee(node_factory, bitcoind):
18791895
"""
18801896
This tests that we don't crash if bitcoind backend gives bad estimatefees.

0 commit comments

Comments
 (0)