Decrement depth

This commit is contained in:
obscuren 2015-03-23 21:48:31 +01:00
parent f2f65c1a65
commit ebf4408d73
1 changed files with 3 additions and 1 deletions

View File

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