aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-07-10 21:31:48 +0800
committerobscuren <geffobscura@gmail.com>2014-07-10 21:31:48 +0800
commit9688ebef523fdd368f7d0596f4529b7e3bc26775 (patch)
tree0c93967720bee3307ad04d2ad6cb4dbeedb46232 /ethchain
parentd6753b28836840f48d46a107f029d5d4f59a1d4b (diff)
downloaddexon-9688ebef523fdd368f7d0596f4529b7e3bc26775.tar.gz
dexon-9688ebef523fdd368f7d0596f4529b7e3bc26775.tar.zst
dexon-9688ebef523fdd368f7d0596f4529b7e3bc26775.zip
Return from execution immediately if there's no code
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/vm.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ethchain/vm.go b/ethchain/vm.go
index 56456fdab..c63b5392f 100644
--- a/ethchain/vm.go
+++ b/ethchain/vm.go
@@ -107,6 +107,11 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
}
}()
+ // Don't bother with the execution if there's no code.
+ if len(closure.Script) == 0 {
+ return closure.Return(nil), nil
+ }
+
vmlogger.Debugf("(%s) %x gas: %v (d) %x\n", vm.Fn, closure.object.Address(), closure.Gas, closure.Args)
var (