diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -291,56 +291,13 @@ return true; } -static inline bool IsOpcodeDisabled(opcodetype opcode, uint32_t flags) { - bool fEnabledOpCodesMonolith = - (flags & SCRIPT_ENABLE_MONOLITH_OPCODES) != 0; - - if (fEnabledOpCodesMonolith) { - switch (opcode) { - case OP_CAT: - return true; - - case OP_SPLIT: - return true; - - case OP_BIN2NUM: - return true; - - case OP_NUM2BIN: - return true; - - case OP_AND: - return false; - - case OP_OR: - return false; - - case OP_XOR: - return false; - - case OP_MUL: - return true; - - case OP_DIV: - return true; - - case OP_MOD: - return true; - - default: - break; - } - } - +static bool IsOpcodeDisabled(opcodetype opcode, uint32_t flags) { switch (opcode) { case OP_CAT: case OP_SPLIT: case OP_BIN2NUM: case OP_NUM2BIN: case OP_INVERT: - case OP_AND: - case OP_OR: - case OP_XOR: case OP_2MUL: case OP_2DIV: case OP_MUL: @@ -348,8 +305,17 @@ case OP_MOD: case OP_LSHIFT: case OP_RSHIFT: + // Disabled opcodes. return true; + case OP_AND: + case OP_OR: + case OP_XOR: + // Opcodes that have been reenabled. + if ((flags & SCRIPT_ENABLE_MONOLITH_OPCODES) == 0) { + return true; + } + default: break; }