test: Read debug log for self-checking comment
What changed, and why it matters
This is a minor test-only change. It updates a functional test comment and replaces a stale comment with an actual check that the expected debug log message appears. There is no change to production code, no security fix, and no vulnerability.
No action required. This is a non-security test-only cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/p2p_segwit.py to use assert_debug_log to verify that a malformed SegWit block triggers the expected ‘DataStream::read(): end of data’ exception, instead of merely having a comment describing the old ‘CDataStream’ error. It is a test hygiene/refactoring change only.
Changed components
test/functional/p2p_segwit.pyInspect captured patch +2 / −2
diff --git a/test/functional/p2p_segwit.py b/test/functional/p2p_segwit.py
index 88b2bcbb..17f8085b 100755
--- a/test/functional/p2p_segwit.py
+++ b/test/functional/p2p_segwit.py
@@ -1198,8 +1198,8 @@ class SegWitTest(BitcoinTestFramework):
block.vtx = [block.vtx[0]]
self.update_witness_block_with_transactions(block, [tx2])
# This block doesn't result in a specific reject reason, but an iostream exception:
- # "Exception 'CDataStream::read(): end of data: unspecified iostream_category error' (...) caught"
- test_witness_block(self.nodes[0], self.test_node, block, accepted=False)
+ with self.nodes[0].assert_debug_log(["Exception 'DataStream::read(): end of data"]):
+ test_witness_block(self.nodes[0], self.test_node, block, accepted=False)
# Now make one of the intermediate witnesses be incorrect
tx2.wit.vtxinwit.append(CTxInWitness())
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.