tests: lnpeer: simplify MockNetwork: rm dead code
What changed, and why it matters
This commit removes five lines of unused test-only code from a mock network class used in Electrum's Lightning peer unit tests. It is a routine cleanup with no effect on production software or user security.
No security action required. Treat as normal code hygiene.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff deletes self.callbacks = defaultdict(list) and the callback_lock property from MockNetwork in tests/test_lnpeer.py. The commit message states this code has been dead since commit 92244041081db96b92925c9e76b117035e241011. The change is confined to test infrastructure and does not alter any runtime Lightning wallet, networking, or cryptographic logic.
Changed components
tests/test_lnpeer.pyMockNetwork test fixtureInspect captured patch +0 / −5
diff --git a/tests/test_lnpeer.py b/tests/test_lnpeer.py
index 1baf3b1..536a21e 100644
--- a/tests/test_lnpeer.py
+++ b/tests/test_lnpeer.py
@@ -68,7 +68,6 @@ def noop_lock():
class MockNetwork:
def __init__(self, tx_queue, *, config: SimpleConfig):
- self.callbacks = defaultdict(list)
self.lnwatcher = None
self.interface = None
self.fee_estimates = FeeTimeEstimates()
@@ -82,10 +81,6 @@ class MockNetwork:
self.tx_queue = tx_queue
self._blockchain = MockBlockchain()
- @property
- def callback_lock(self):
- return noop_lock()
-
def get_local_height(self):
return self.blockchain().height()
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.