What changed, and why it matters
This is a one-line fix in Electrum's test suite. A previous change accidentally used the real network Peer class instead of a special test-only version (PeerInTests) in a Lightning network test. The test-only version processes messages immediately, which a specific test needs to avoid timing-related failures. This commit restores the test-only class, fixing a flaky unit test. It is not a security fix and does not affect production code.
No security action required; this is a test-only reliability fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
Commit dee2371738f390050c89f4d601d9199c76ca272c changes tests/test_lnpeer.py to instantiate PeerInTests instead of Peer. PeerInTests sets Peer.DELAY_INC_MSG_PROCESSING_SLEEP to 0, eliminating the artificial message-processing delay. The delay caused test_reestablish_with_old_state to fail intermittently because Bob would receive an old channel state and disconnect before Alice finished processing Bob’s response while still in ChannelState.REESTABLISHING. The change only affects test code and has no runtime security implications.
Changed components
tests/test_lnpeer.pyInspect captured patch +1 / −1
diff --git a/tests/test_lnpeer.py b/tests/test_lnpeer.py
index afb6f0a..6107a8b 100644
--- a/tests/test_lnpeer.py
+++ b/tests/test_lnpeer.py
@@ -535,7 +535,7 @@ class TestPeer(ElectrumTestCase):
# create peers
for ab in channels.keys():
- peers[ab] = Peer(workers[ab[0]], keys[ab[1]].pubkey, transports[ab])
+ peers[ab] = PeerInTests(workers[ab[0]], keys[ab[1]].pubkey, transports[ab])
# add peers to workers
for a, w in workers.items():
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.