Skip to content

Commit 0684503

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

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_plugin.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1875,6 +1875,23 @@ 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+
if "LIGHTNINGD_DEV_MEMLEAK" in l1.daemon.env:
1884+
del l1.daemon.env["LIGHTNINGD_DEV_MEMLEAK"]
1885+
l1.start()
1886+
addrs = {addr: 0.00200000 for addr in [l1.rpc.newaddr('bech32')['bech32'] for _ in range(700)]}
1887+
bitcoind.rpc.sendmany("", addrs)
1888+
bitcoind.generate_block(1, wait_for_mempool=1)
1889+
sync_blockheight(bitcoind, [l1])
1890+
1891+
l1.rpc.withdraw(bitcoind.getnewaddress(), 'all')
1892+
bitcoind.generate_block(1, wait_for_mempool=1)
1893+
1894+
18781895
def test_bitcoin_bad_estimatefee(node_factory, bitcoind):
18791896
"""
18801897
This tests that we don't crash if bitcoind backend gives bad estimatefees.

0 commit comments

Comments
 (0)