disabled ops.

This commit is contained in:
Christopher Jeffrey 2016-06-16 02:23:36 -07:00
parent fca282acdb
commit 51f3d7120b
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1242,22 +1242,23 @@ Script.prototype.execute = function execute(stack, flags, tx, index, version) {
// are in unexecuted branches of code_. Whereas
// a totally unknown opcode is fine as long as it
// is unexecuted.
if (op === opcodes.OP_CAT
|| op === opcodes.OP_SUBSTR
|| op === opcodes.OP_LEFT
|| op === opcodes.OP_RIGHT
|| op === opcodes.OP_INVERT
|| op === opcodes.OP_AND
|| op === opcodes.OP_OR
|| op === opcodes.OP_XOR
|| op === opcodes.OP_2MUL
|| op === opcodes.OP_2DIV
|| op === opcodes.OP_MUL
|| op === opcodes.OP_DIV
|| op === opcodes.OP_MOD
|| op === opcodes.OP_LSHIFT
|| op === opcodes.OP_RSHIFT) {
throw new ScriptError('DISABLED_OPCODE', op, ip);
switch (op) {
case opcodes.OP_CAT:
case opcodes.OP_SUBSTR:
case opcodes.OP_LEFT:
case opcodes.OP_RIGHT:
case opcodes.OP_INVERT:
case opcodes.OP_AND:
case opcodes.OP_OR:
case opcodes.OP_XOR:
case opcodes.OP_2MUL:
case opcodes.OP_2DIV:
case opcodes.OP_MUL:
case opcodes.OP_DIV:
case opcodes.OP_MOD:
case opcodes.OP_LSHIFT:
case opcodes.OP_RSHIFT:
throw new ScriptError('DISABLED_OPCODE', op, ip);
}
if (op >= opcodes.OP_IF && op <= opcodes.OP_ENDIF) {