fuzz: set fSuccessfullyConnected in connman harness
What changed, and why it matters
This commit fixes a Bitcoin Core fuzz test harness so that simulated peer nodes are marked as successfully connected. Without this flag, the test's code coverage was poor because the harness filtered out all fake nodes before running important connection-management logic. It is a test-only improvement with no effect on live Bitcoin node behavior or user funds.
No security action required. Treat as a normal test-quality improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/test/fuzz/connman.cpp, the fuzz target now sets CNode::fSuccessfullyConnected = true on each fuzz-constructed node before adding it to the connection manager via AddTestNode. NodeFullyConnected() checks this flag, so previously every fuzz node was skipped by ForEachNode callbacks, resulting in ~0 branch hits for that path. The change improves fuzz coverage of connman logic but does not alter production consensus or networking code.
Changed components
src/test/fuzz/connman.cppInspect captured patch +2 / −0
diff --git a/src/test/fuzz/connman.cpp b/src/test/fuzz/connman.cpp
index 4a8b7b21..6d28e72f 100644
--- a/src/test/fuzz/connman.cpp
+++ b/src/test/fuzz/connman.cpp
@@ -89,6 +89,8 @@ FUZZ_TARGET(connman, .init = initialize_connman)
LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 100) {
CNode& p2p_node{*ConsumeNodeAsUniquePtr(fuzzed_data_provider).release()};
+ // Simulate post-handshake state.
+ p2p_node.fSuccessfullyConnected = true;
connman.AddTestNode(p2p_node);
}
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.