test: Remove unused wait_for_addr, firstAddrnServices, on_addr
What changed, and why it matters
This commit removes unused helper code from a single Bitcoin Core functional test file. It deletes three methods/variables that are no longer referenced after an earlier commit. There is no change to production code, network behavior, or wallet logic, and no security relevance.
No security action needed. This is a routine test-maintenance cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff removes firstAddrnServices, on_addr, and wait_for_addr from the P2PIgnoreInv class in test/functional/p2p_node_network_limited.py. These were test-only helpers that became unused after commit be25ac3092b7755e26e1ec6c33a27cd0e3dd9eac. The change is purely a cleanup of dead code in the test suite.
Changed components
test/functional/p2p_node_network_limited.pyInspect captured patch +0 / −6
diff --git a/test/functional/p2p_node_network_limited.py b/test/functional/p2p_node_network_limited.py
index 8140823f..8e1062cd 100755
--- a/test/functional/p2p_node_network_limited.py
+++ b/test/functional/p2p_node_network_limited.py
@@ -28,15 +28,9 @@ from test_framework.util import (
NODE_NETWORK_LIMITED_MIN_BLOCKS = 288
class P2PIgnoreInv(P2PInterface):
- firstAddrnServices = 0
def on_inv(self, message):
# The node will send us invs for other blocks. Ignore them.
pass
- def on_addr(self, message):
- self.firstAddrnServices = message.addrs[0].nServices
- def wait_for_addr(self, timeout=5):
- test_function = lambda: self.last_message.get("addr")
- self.wait_until(test_function, timeout=timeout)
def send_getdata_for_block(self, blockhash):
getdata_request = msg_getdata()
getdata_request.inv.append(CInv(MSG_BLOCK, int(blockhash, 16)))
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.