Skip to content

Commit 3e7531d

Browse files
committed
pytest: add test that we fixup "pending" payments which don't actually have HTLCs.
And don't fix up a genuine pending one! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent fc2fb7c commit 3e7531d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
9.55 KB
Binary file not shown.

tests/test_wallet.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2467,3 +2467,13 @@ def test_old_htlcs_cleanup(node_factory, bitcoind):
24672467
# Now they're not
24682468
assert l1.db_query('SELECT COUNT(*) as c FROM channel_htlcs')[0]['c'] == 0
24692469
assert l1.rpc.listhtlcs() == {'htlcs': []}
2470+
2471+
2472+
@pytest.mark.xfail(strict=True)
2473+
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "Makes use of the sqlite3 db")
2474+
@unittest.skipIf(TEST_NETWORK != 'regtest', "sqlite3 snapshot is regtest")
2475+
def test_pending_payments_cleanup(node_factory, bitcoind):
2476+
bitcoind.generate_block(1)
2477+
l1 = node_factory.get_node(dbfile='l1-pending-sendpays-with-no-htlc.sqlite3.xz', options={'database-upgrade': True})
2478+
assert [p['status'] for p in l1.rpc.listsendpays()['payments']] == ['failed', 'pending']
2479+
assert [p['status'] for p in l1.rpc.listpays()['pays']] == ['pending']

0 commit comments

Comments
 (0)