Skip to content

Commit e1e729a

Browse files
rustyrussellmadelinevibes
authored andcommitted
pytest: test for bcli crash with huge PSBTs.
Signed-off-by: Rusty Russell <[email protected]>
1 parent a3b5571 commit e1e729a

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
@@ -1852,6 +1852,23 @@ def test_bitcoin_backend(node_factory, bitcoind):
18521852
" bitcoind")
18531853

18541854

1855+
@pytest.mark.xfail(strict=True)
1856+
def test_bitcoin_backend_gianttx(node_factory, bitcoind):
1857+
"""Test that a giant tx doesn't crash bcli"""
1858+
l1 = node_factory.get_node(start=False)
1859+
# With memleak we spend far too much time gathering backtraces.
1860+
if "LIGHTNINGD_DEV_MEMLEAK" in l1.daemon.env:
1861+
del l1.daemon.env["LIGHTNINGD_DEV_MEMLEAK"]
1862+
l1.start()
1863+
addrs = {addr: 0.00200000 for addr in [l1.rpc.newaddr('bech32')['bech32'] for _ in range(700)]}
1864+
bitcoind.rpc.sendmany("", addrs)
1865+
bitcoind.generate_block(1, wait_for_mempool=1)
1866+
sync_blockheight(bitcoind, [l1])
1867+
1868+
l1.rpc.withdraw(bitcoind.getnewaddress(), 'all')
1869+
bitcoind.generate_block(1, wait_for_mempool=1)
1870+
1871+
18551872
def test_bitcoin_bad_estimatefee(node_factory, bitcoind):
18561873
"""
18571874
This tests that we don't crash if bitcoind backend gives bad estimatefees.

0 commit comments

Comments
 (0)