From ebf4408d738474835582485bb4ef45bf55a05a9c Mon Sep 17 00:00:00 2001
From: obscuren <geffobscura@gmail.com>
Date: Mon, 23 Mar 2015 21:48:31 +0100
Subject: [PATCH] Decrement depth

---
 core/vm/vm.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/vm/vm.go b/core/vm/vm.go
index f4bf1ca72..2ece5b928 100644
--- a/core/vm/vm.go
+++ b/core/vm/vm.go
@@ -5,8 +5,8 @@ import (
 	"math/big"
 
 	"github.com/ethereum/go-ethereum/common"
-	"github.com/ethereum/go-ethereum/crypto"
 	"github.com/ethereum/go-ethereum/core/state"
+	"github.com/ethereum/go-ethereum/crypto"
 )
 
 type Vm struct {
@@ -34,6 +34,8 @@ func New(env Environment) *Vm {
 
 func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) {
 	self.env.SetDepth(self.env.Depth() + 1)
+	defer self.env.SetDepth(self.env.Depth() - 1)
+
 	var (
 		caller = context.caller
 		code   = context.Code
-- 
GitLab