From 4ce5ca4d80cde79de60d545a7b992907cc5450e4 Mon Sep 17 00:00:00 2001 From: Michael Mallan Date: Wed, 29 Jan 2025 11:13:19 +0000 Subject: [PATCH] qa: check psbt must be saved in db to use rbf --- tests/test_rpc.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_rpc.py b/tests/test_rpc.py index 307fb691..aa43811e 100644 --- a/tests/test_rpc.py +++ b/tests/test_rpc.py @@ -1143,6 +1143,15 @@ def test_rbfpsbt_bump_fee(lianad, bitcoind): lianad.rpc.rbfpsbt(first_txid, False, 1) # Using a higher feerate works. lianad.rpc.rbfpsbt(first_txid, False, 2) + + # But we cannot use RBF if the PSBT is no longer in the DB. + lianad.rpc.delspendtx(first_txid) + with pytest.raises(RpcError, match=f"Unknown spend transaction '{first_txid}'."): + lianad.rpc.rbfpsbt(first_txid, False, 2) + + # Now re-save the PSBT in the DB. + lianad.rpc.updatespend(first_psbt.to_base64()) + # Let's use an even higher feerate. rbf_1_res = lianad.rpc.rbfpsbt(first_txid, False, 10) rbf_1_psbt = PSBT.from_base64(rbf_1_res["psbt"])