opcode == OP_RSHIFT)
return false; // Disabled opcodes.
- if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4)
+ if (fExec && opcode <= OP_PUSHDATA4)
stack.push_back(vchPushValue);
else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
switch (opcode)
case OP_16:
{
// ( -- value)
- CBigNum bn((int)opcode - (int)(OP_1 - 1));
+ CBigNum bn(opcode - (OP_1 - 1));
stack.push_back(bn.getvch());
}
break;
const char* GetTxnOutputType(txnouttype t);
// Script opcodes
-enum opcodetype
+enum opcodetype : uint8_t
{
// push value
OP_0 = 0x00,
CScript& operator<<(opcodetype opcode)
{
- if (opcode < 0 || opcode > 0xff)
- throw std::runtime_error("CScript::operator<<() : invalid opcode");
- insert(end(), (uint8_t)opcode);
+ insert(end(), opcode);
return *this;
}
str += "[error]";
return str;
}
- if (0 <= opcode && opcode <= OP_PUSHDATA4)
+ if (opcode <= OP_PUSHDATA4)
str += fShort? ValueString(vch).substr(0, 10) : ValueString(vch);
else
str += GetOpName(opcode);