From b4c3be9abcb759bf9ad2bd3037a257b5c6ff0005 Mon Sep 17 00:00:00 2001 From: Michael Schmoock Date: Tue, 12 Nov 2019 17:15:13 +0100 Subject: [PATCH] pytest: add test for raising listtransactions after funding --- tests/test_wallet.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_wallet.py b/tests/test_wallet.py index 03a6556097a1..404adeabeb23 100644 --- a/tests/test_wallet.py +++ b/tests/test_wallet.py @@ -663,3 +663,18 @@ def test_hsmtool_secret_decryption(node_factory): l1.daemon.opts.pop("encrypted-hsm") l1.daemon.start(stdin=slave_fd, wait_for_initialized=True) assert node_id == l1.rpc.getinfo()["id"] + + +# this test does a 'listtransactions' on a yet unconfirmed channel +def test_fundchannel_listtransaction(node_factory, bitcoind): + l1, l2 = node_factory.get_nodes(2) + l1.fundwallet(10**6) + + l1.connect(l2) + txid = l1.rpc.fundchannel(l2.info['id'], 10**5)['txid'] + + # next call warned about SQL Accessing a null column + # and crashed the daemon for accessing random memory or null + txs = l1.rpc.listtransactions()['transactions'] + assert txs[0]['hash'] == txid + assert txs[0]['blockheight'] == 0