message: Add helper function for disabled opcodes
  Summary:
  Add `IsOpcodeDisabled` helper function to see if an opcode
  is supposed to be disabled or not
  Test Plan: `make check`
  Reviewers: deadalnix, jasonbcox, movrcx, matiu, #bitcoin_abc
  Subscribers: teamcity
diff: @@ -291,6 +291,75 @@ bool static CheckMinimalPush(const valtype &data, opcodetype opcode)
  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 true;
  +
  + case OP_OR:
  + return true;
  +
  + case OP_XOR:
  + return true;
  +
  + case OP_MUL:
  + return true;
  +
  + case OP_DIV:
  + return true;
  +
  + case OP_MOD:
  + return true;
  +
  + default:
  + break;
  + }
  + }
  +
  + 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:
  + case OP_DIV:
  + case OP_MOD:
  + case OP_LSHIFT:
  + case OP_RSHIFT:
  + return true;
  +
  + default:
  + break;
  + }
  +
  + return false;
  +}
  +
  bool EvalScript(vector<vector<unsigned char> > &stack,
  const CScript &script,
  unsigned int flags,
  @@ -340,27 +409,9 @@ bool EvalScript(vector<vector<unsigned char> > &stack,
  return set_error(serror, SCRIPT_ERR_OP_COUNT);
  // Some opcodes are disabled.
  - switch (opcode)
  + if (IsOpcodeDisabled(opcode, flags))
  {
  - 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:
  - case OP_DIV:
  - case OP_MOD:
  - case OP_LSHIFT:
  - case OP_RSHIFT:
  return set_error(serror, SCRIPT_ERR_DISABLED_OPCODE);
  -
  - default:
  - break;
  }
  if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4)
  