test: respect "TAPROOT requires WITNESS" rule in ValidateCheckInputsForAllFlags

This is preparatory for the next commit, which introduces Taproot spends
that would fail without this rule being enforced.

While touching the function, also remove an outdated comment that refers
to a parameter that doesn't exist anymore (`upgraded_nop` was removed
in commit 01013f5d2f, PR #10699).
This commit is contained in:
Sebastian Falbesoner
2026-06-07 01:58:34 +02:00
parent e78a2a0d00
commit 198b36bc85

View File

@@ -114,8 +114,6 @@ BOOST_FIXTURE_TEST_CASE(tx_mempool_block_doublespend, Dersig100Setup)
// CHECKLOCKTIMEVERIFY (or CHECKSEQUENCEVERIFY), but the script does contain
// OP_CHECKLOCKTIMEVERIFY (or OP_CHECKSEQUENCEVERIFY), then script execution
// should fail.
// Capture this interaction with the upgraded_nop argument: set it when evaluating
// any script flag that is implemented as an upgraded NOP code.
static void ValidateCheckInputsForAllFlags(const CTransaction &tx, script_verify_flags failing_flags, bool add_to_cache, CCoinsViewCache& active_coins_tip, ValidationCache& validation_cache) EXCLUSIVE_LOCKS_REQUIRED(::cs_main)
{
PrecomputedTransactionData txdata;
@@ -134,6 +132,10 @@ static void ValidateCheckInputsForAllFlags(const CTransaction &tx, script_verify
// script/interpreter.cpp
test_flags |= SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_WITNESS;
}
if ((test_flags & SCRIPT_VERIFY_TAPROOT)) {
// TAPROOT requires WITNESS
test_flags |= SCRIPT_VERIFY_WITNESS;
}
if ((test_flags & SCRIPT_VERIFY_WITNESS)) {
// WITNESS requires P2SH
test_flags |= SCRIPT_VERIFY_P2SH;