From 4eb1771e67ee2c66d5fb86c2b5961d84e40f7dd0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 27 May 2014 13:32:31 +0200 Subject: Hooks can now quit the vm --- ethchain/vm.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ethchain/vm.go') 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 + } } } } -- cgit v1.2.3