pytest: test for bcli crash with huge PSBTs.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2025-11-03 13:04:50 +10:30
parent 48c3df9175
commit 5d64eb9ac4

View file

@ -1875,6 +1875,23 @@ def test_bitcoin_backend(node_factory, bitcoind):
" bitcoind")
@pytest.mark.xfail(strict=True)
def test_bitcoin_backend_gianttx(node_factory, bitcoind):
"""Test that a giant tx doesn't crash bcli"""
l1 = node_factory.get_node(start=False)
# With memleak we spend far too much time gathering backtraces.
if "LIGHTNINGD_DEV_MEMLEAK" in l1.daemon.env:
del l1.daemon.env["LIGHTNINGD_DEV_MEMLEAK"]
l1.start()
addrs = {addr: 0.00200000 for addr in [l1.rpc.newaddr('bech32')['bech32'] for _ in range(700)]}
bitcoind.rpc.sendmany("", addrs)
bitcoind.generate_block(1, wait_for_mempool=1)
sync_blockheight(bitcoind, [l1])
l1.rpc.withdraw(bitcoind.getnewaddress(), 'all')
bitcoind.generate_block(1, wait_for_mempool=1)
def test_bitcoin_bad_estimatefee(node_factory, bitcoind):
"""
This tests that we don't crash if bitcoind backend gives bad estimatefees.