test: restore assertion that tx contains exactly 2500 sigops
What changed, and why it matters
This is a tiny test-only change that adds a missing assertion in a unit test. It does not change any production code, network rules, or wallet behavior. There is no security issue here.
No action needed. This is a benign test-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit adds a BOOST_CHECK_EQUAL in src/test/transaction_tests.cpp to verify that the constructed test transaction has exactly MAX_TX_LEGACY_SIGOPS (2500) legacy signature operations before calling ValidateInputsStandardness. It is purely a regression test improvement and does not alter consensus, mempool policy, or validation logic.
Changed components
src/test/transaction_tests.cppInspect captured patch +1 / −0
diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp
index a8a596f5..a5b123ed 100644
--- a/src/test/transaction_tests.cpp
+++ b/src/test/transaction_tests.cpp
@@ -1089,6 +1089,7 @@ BOOST_AUTO_TEST_CASE(max_standard_legacy_sigops)
AddCoins(coins, CTransaction(tx_create_p2pk), 0, false);
// The transaction now contains exactly 2500 sigops, the check should pass.
+ BOOST_CHECK_EQUAL(p2sh_inputs_count * MAX_P2SH_SIGOPS + p2pk_inputs_count * 1, MAX_TX_LEGACY_SIGOPS);
BOOST_CHECK(::ValidateInputsStandardness(CTransaction(tx_max_sigops), coins).IsValid());
// Now, add some Segwit inputs. We add one for each defined Segwit output type. The limit
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.