core/vm: fixed statdb issue for copy & return

This commit is contained in:
Jeffrey Wilcke 2016-10-04 12:00:31 +02:00
parent 4573773a91
commit a80800f56b

View file

@ -116,7 +116,6 @@ func (evm *EVM) Run(contract *Contract, input []byte) (ret []byte, err error) {
op OpCode // current opcode
mem = NewMemory() // bound memory
stack = newstack() // local stack
statedb = evm.env.Db() // current state
// For optimisation reason we're using uint64 as the program counter.
// It's theoretically possible to go above 2^64. The YP defines the PC to be uint256. Practically much less so feasible.
pc = uint64(0) // program counter
@ -169,7 +168,7 @@ func (evm *EVM) Run(contract *Contract, input []byte) (ret []byte, err error) {
// Get the memory location of pc
op = contract.GetOp(pc)
// calculate the new memory size and gas price for the current executing opcode
newMemSize, cost, err = calculateGasAndSize(evm.env, contract, caller, op, statedb, mem, stack)
newMemSize, cost, err = calculateGasAndSize(evm.env, contract, caller, op, evm.env.Db(), mem, stack)
if err != nil {
return nil, err
}