test: align test better with described scenario
What changed, and why it matters
This is a tiny change to a single unit test in Bitcoin Core. It swaps which test transaction is used in one assertion so the test matches the scenario described in the comment above it. There is no change to production code, no security fix, and no vulnerability.
No security action needed. Treat as a normal test-quality improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In src/test/private_broadcast_tests.cpp, the rejection_at_cap test removes a transaction named ‘fresh’ and then checks that a previously-removed transaction can be re-added. The original code re-added txs[0], which did not match the comment and the immediately preceding Remove(fresh) call. The patch changes the Add call to use ‘fresh’ instead, making the test consistent with its stated scenario. This is purely a test-clarity/correctness change.
Changed components
src/test/private_broadcast_tests.cppInspect captured patch +1 / −1
diff --git a/src/test/private_broadcast_tests.cpp b/src/test/private_broadcast_tests.cpp
index 146082b2..c65d44c5 100644
--- a/src/test/private_broadcast_tests.cpp
+++ b/src/test/private_broadcast_tests.cpp
@@ -217,7 +217,7 @@ BOOST_AUTO_TEST_CASE(rejection_at_cap)
// A previously-removed tx can be added again as a brand-new entry.
BOOST_REQUIRE(pb.Remove(fresh).has_value());
- BOOST_CHECK_EQUAL(pb.Add(txs[0]), PrivateBroadcast::AddResult::Added);
+ BOOST_CHECK_EQUAL(pb.Add(fresh), PrivateBroadcast::AddResult::Added);
BOOST_CHECK_EQUAL(pb.GetBroadcastInfo().size(), num_cap);
}
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.