diff --git a/neo/VM/ExecutionEngine.py b/neo/VM/ExecutionEngine.py index 1570b4234..bc0ac936b 100644 --- a/neo/VM/ExecutionEngine.py +++ b/neo/VM/ExecutionEngine.py @@ -758,6 +758,15 @@ def ExecuteOp(self, opcode, context): estack.PushT(Struct(items)) + elif opcode == THROW: + self._VMState |= VMState.FAULT + return + + elif opcode == THROWIFNOT: + if estack.Pop().GetBoolean() == False: + self._VMState |= VMState.FAULT + return + else: self._VMState |= VMState.FAULT diff --git a/neo/VM/OpCode.py b/neo/VM/OpCode.py index 51f92332d..a5fab458c 100644 --- a/neo/VM/OpCode.py +++ b/neo/VM/OpCode.py @@ -38,6 +38,11 @@ TAILCALL = b'\x69' +# Exceptions +THROW = b'\xf0' +THROWIFNOT = b'\xf1' + + # Stack DUPFROMALTSTACK = b'\x6A' TOALTSTACK = b'\x6B' # Puts the input onto the top of the alt stack. Removes it from the main stack.