From 48fb0c3213a1634a266dd661d30c9ecd3c352f49 Mon Sep 17 00:00:00 2001
From: Felix Lange <fjl@twurst.com>
Date: Fri, 29 May 2015 14:58:57 +0200
Subject: [PATCH] core/vm: check for 'no code' before doing any work

---
 core/vm/vm.go | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/vm/vm.go b/core/vm/vm.go
index 0d8facbb6..2bd950385 100644
--- a/core/vm/vm.go
+++ b/core/vm/vm.go
@@ -71,6 +71,11 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
 		}
 	}
 
+	// Don't bother with the execution if there's no code.
+	if len(code) == 0 {
+		return context.Return(nil), nil
+	}
+
 	var (
 		op       OpCode
 		codehash = crypto.Sha3Hash(code)
@@ -94,11 +99,6 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
 		}
 	)
 
-	// Don't bother with the execution if there's no code.
-	if len(code) == 0 {
-		return context.Return(nil), nil
-	}
-
 	for {
 		// The base for all big integer arithmetic
 		base := new(big.Int)
-- 
GitLab