aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-09-02 18:55:11 +0800
committerFelix Lange <fjl@twurst.com>2015-10-17 16:24:34 +0800
commitde8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608 (patch)
tree59930f3d627940e1b73030ee2c5685104a04ee34 /xeth/xeth.go
parent10ed107ba2001d1aabba3d319ba88c5ce6e8fdc0 (diff)
downloadgo-tangerine-de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608.tar.gz
go-tangerine-de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608.tar.zst
go-tangerine-de8d5aaa92ff843e6960eb9b7bd7ec1c1ebc6608.zip
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.
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go5
1 files changed, 2 insertions, 3 deletions
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
}