pytest: test for bkpr_listbalances after emergencyrecover.
What changed, and why it matters
This commit only adds a test case. It marks an existing emergency recovery test as expected to fail (xfail) and adds a single bookkeeping balance-listing call after recovery. There is no code fix or security change in the diff itself.
No immediate action. If investigating, determine why test_emergencyrecover is failing and whether the failure indicates a real bug in emergencyrecover or bkpr_listbalances. This commit alone does not fix anything.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/test_misc.py: adds @pytest.mark.xfail(strict=True) to test_emergencyrecover and inserts l1.rpc.bkpr_listbalances() after channels reach ONCHAIN state. The change is purely test infrastructure; no production code is patched. The xfail annotation suggests the test currently fails, but the commit does not address the underlying cause.
Changed components
tests/test_misc.pyInspect captured patch +4 / −0
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 5baebbcd..c2e4f0ec 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -3136,6 +3136,7 @@ def test_emergencyrecoverpenaltytxn(node_factory, bitcoind):
@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "deletes database, which is assumed sqlite3")
+@pytest.mark.xfail(strict=True)
def test_emergencyrecover(node_factory, bitcoind):
"""
Test emergencyrecover
@@ -3177,6 +3178,9 @@ def test_emergencyrecover(node_factory, bitcoind):
wait_for(lambda: l1.rpc.listfunds()["channels"][0]["state"] == "ONCHAIN")
wait_for(lambda: l2.rpc.listfunds()["channels"][0]["state"] == "ONCHAIN")
+ # Does bookkeeper get upset?
+ l1.rpc.bkpr_listbalances()
+
withdraw = l1.rpc.withdraw(l2.rpc.newaddr('bech32')['bech32'], 'all')
# Should have two inputs
assert len(bitcoind.rpc.decoderawtransaction(withdraw['tx'])['vin']) == 2
Why this scored 12/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.