diff --git a/src/policy/policy.h b/src/policy/policy.h --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -73,17 +73,6 @@ */ static const Amount DUST_RELAY_TX_FEE(1000 * SATOSHI); -/** - * When transactions fail script evaluations under standard flags, this flagset - * influences the decision of whether to drop them or to also ban the originator - * (see CheckInputs). - */ -static const uint32_t MANDATORY_SCRIPT_VERIFY_FLAGS = - SCRIPT_VERIFY_P2SH | SCRIPT_VERIFY_STRICTENC | - SCRIPT_ENABLE_SIGHASH_FORKID | SCRIPT_VERIFY_LOW_S | - SCRIPT_VERIFY_NULLFAIL | SCRIPT_VERIFY_MINIMALDATA | - SCRIPT_ENABLE_SCHNORR_MULTISIG; - /** * Standard script verification flags that standard transactions will comply * with. However scripts violating these flags may still be present in valid @@ -106,10 +95,16 @@ SCRIPT_VERIFY_INPUT_SIGCHECKS; /** - * For convenience, standard but not mandatory verify flags. + * When transactions fail script evaluations under standard flags, this flagset + * influences the decision of whether to drop them or to also ban the originator + * (see CheckInputs). */ static constexpr uint32_t STANDARD_NOT_MANDATORY_VERIFY_FLAGS = - STANDARD_SCRIPT_VERIFY_FLAGS & ~MANDATORY_SCRIPT_VERIFY_FLAGS; + SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_SIGPUSHONLY | + SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS | SCRIPT_VERIFY_CLEANSTACK | + SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY | SCRIPT_VERIFY_CHECKSEQUENCEVERIFY | + SCRIPT_VERIFY_CHECKDATASIG_SIGOPS | SCRIPT_DISALLOW_SEGWIT_RECOVERY | + SCRIPT_VERIFY_INPUT_SIGCHECKS; /** * Used as the flags parameter to sequence and nLocktime checks in non-consensus diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1277,10 +1277,8 @@ } ScriptError scriptError = check.GetScriptError(); + // Compute flags without the optional standardness flags. - // This differs from MANDATORY_SCRIPT_VERIFY_FLAGS as it contains - // additional upgrade flags (see AcceptToMemoryPoolWorker variable - // extraFlags). uint32_t mandatoryFlags = flags & ~STANDARD_NOT_MANDATORY_VERIFY_FLAGS; if (flags != mandatoryFlags) {