What changed, and why it matters
This commit fixes a typo in a single test file. The test was accidentally running the same helper function twice (p1.htlc_switch() called twice) instead of running it once for each of two simulated participants (p1 and p2). The change makes the test more realistic but does not alter any production code, so it cannot affect real users or wallets.
No security action required. Treat as a normal test-quality fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In tests/test_lnpeer.py, an asyncio.gather() call in test_reestablish was spawning p1.htlc_switch() twice and never spawning p2.htlc_switch(). The patch replaces the second p1.htlc_switch() with p2.htlc_switch(). This is purely a test-code correctness fix; no library or application logic is modified.
Changed components
tests/test_lnpeer.pyInspect captured patch +1 / −1
diff --git a/tests/test_lnpeer.py b/tests/test_lnpeer.py
index 6107a8b..f5e02e6 100644
--- a/tests/test_lnpeer.py
+++ b/tests/test_lnpeer.py
@@ -634,7 +634,7 @@ class TestPeerDirect(TestPeer):
self.assertEqual(alice_channel.peer_state, PeerState.GOOD)
self.assertEqual(bob_channel.peer_state, PeerState.GOOD)
gath.cancel()
- gath = asyncio.gather(reestablish(), p1._message_loop(), p2._message_loop(), p1.htlc_switch(), p1.htlc_switch())
+ gath = asyncio.gather(reestablish(), p1._message_loop(), p2._message_loop(), p1.htlc_switch(), p2.htlc_switch())
with self.assertRaises(asyncio.CancelledError):
await gath
Why this scored 15/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.