Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bkpr: fixup htlc penalty test with anchors
Test flake where the balance for lightning-2 went negative ``` > assert account_balance(l2, channel_id) == 0 tests/test_closing.py:1314: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ tests/utils.py:183: in account_balance m_sum -= Millisatoshi(m['debit_msat']) contrib/pyln-client/pyln/client/lightning.py:193: in __sub__ return Millisatoshi(int(self) - int(other)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = -10000msat, v = -10000 ``` Led me to look into this test. lightning-2 should go negative since we roll back the amounts it's received by going to a prior database state. Rather than trying to do the right thing with obviously broken node records, instead we just stop trying to account for them correctly (impossible). I also noticed that the anchor tests were failing the utxo output matchup, which we should be asserting on it. The HTLC RBF that our anchor code creates was causing an issue by creating another wallet deposit utxo under the HTLC output. We now optionally add this utxo in the case that anchors are turned on. Changelog-None: Fix test flake
- Loading branch information