From de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 2 Sep 2015 12:55:11 +0200 Subject: core, core/state: move gas tracking out of core/state The amount of gas available for tx execution was tracked in the StateObject representing the coinbase account. This commit makes the gas counter a separate type in package core, which avoids unintended consequences of intertwining the counter with state logic. --- xeth/xeth.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'xeth') diff --git a/xeth/xeth.go b/xeth/xeth.go index baa8314ad..1cb072f0d 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -850,7 +850,6 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st } from.SetBalance(common.MaxBig) - from.SetGasLimit(common.MaxBig) msg := callmsg{ from: from, @@ -874,8 +873,8 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st header := self.CurrentBlock().Header() vmenv := core.NewEnv(statedb, self.backend.BlockChain(), msg, header) - - res, gas, err := core.ApplyMessage(vmenv, msg, from) + gp := new(core.GasPool).AddGas(common.MaxBig) + res, gas, err := core.ApplyMessage(vmenv, msg, gp) return common.ToHex(res), gas.String(), err } -- cgit v1.2.3