diff --git a/src/policy/policy.h b/src/policy/policy.h index 6330127c8030fd..6810a2ab94302a 100644 --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -116,8 +116,7 @@ static constexpr unsigned int STANDARD_SCRIPT_VERIFY_FLAGS{MANDATORY_SCRIPT_VERI SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE | SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_CHECK_TEMPLATE_VERIFY_HASH | SCRIPT_VERIFY_DEFAULT_CHECK_TEMPLATE_VERIFY_HASH | - SCRIPT_VERIFY_ANYPREVOUT | - SCRIPT_VERIFY_DISCOURAGE_ANYPREVOUT}; + SCRIPT_VERIFY_ANYPREVOUT}; /** For convenience, standard but not mandatory verify flags. */ static constexpr unsigned int STANDARD_NOT_MANDATORY_VERIFY_FLAGS{STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS}; diff --git a/src/validation.cpp b/src/validation.cpp index 2923b3eed864cd..5e2f05a1073858 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1232,7 +1232,10 @@ bool MemPoolAccept::PolicyScriptChecks(const ATMPArgs& args, Workspace& ws) TxValidationState& state = ws.m_state; const bool ctv_active = DeploymentActiveAfter(m_active_chainstate.m_chain.Tip(), m_active_chainstate.m_chainman, Consensus::DEPLOYMENT_CHECKTEMPLATEVERIFY); - const unsigned int scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS | (ctv_active ? SCRIPT_VERIFY_NONE : SCRIPT_VERIFY_DISCOURAGE_CHECK_TEMPLATE_VERIFY_HASH); + const bool apo_active = DeploymentActiveAfter(m_active_chainstate.m_chain.Tip(), m_active_chainstate.m_chainman, Consensus::DEPLOYMENT_ANYPREVOUT); + const unsigned int scriptVerifyFlags = STANDARD_SCRIPT_VERIFY_FLAGS + | (ctv_active ? SCRIPT_VERIFY_NONE : SCRIPT_VERIFY_DISCOURAGE_CHECK_TEMPLATE_VERIFY_HASH) + | (apo_active ? SCRIPT_VERIFY_NONE : SCRIPT_VERIFY_DISCOURAGE_ANYPREVOUT); // Check input scripts and signatures. // This is done last to help prevent CPU exhaustion denial-of-service attacks.