diff options
-rw-r--r-- | ethchain/closure.go | 2 | ||||
-rw-r--r-- | ethchain/vm.go | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/ethchain/closure.go b/ethchain/closure.go index e65cfd252..c935ed50a 100644 --- a/ethchain/closure.go +++ b/ethchain/closure.go @@ -72,7 +72,7 @@ func (c *Closure) Address() []byte { return c.object.Address() } -type DebugHook func(step int, op OpCode, mem *Memory, stack *Stack, stateObject *StateObject) +type DebugHook func(step int, op OpCode, mem *Memory, stack *Stack, stateObject *StateObject) bool func (c *Closure) Call(vm *Vm, args []byte, hook DebugHook) ([]byte, error) { c.Args = args diff --git a/ethchain/vm.go b/ethchain/vm.go index 0d9e8599e..9821a839a 100644 --- a/ethchain/vm.go +++ b/ethchain/vm.go @@ -543,7 +543,9 @@ func (vm *Vm) RunClosure(closure *Closure, hook DebugHook) (ret []byte, err erro pc.Add(pc, ethutil.Big1) if hook != nil { - hook(step-1, op, mem, stack, closure.Object()) + if !hook(step-1, op, mem, stack, closure.Object()) { + return nil, nil + } } } } |