aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xeth/xeth.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 1ddd4c6e4..11dc506b8 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -787,6 +787,7 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
from = statedb.GetOrNewStateObject(common.HexToAddress(fromStr))
}
+ from.SetGasPool(self.backend.ChainManager().GasLimit())
msg := callmsg{
from: from,
to: common.HexToAddress(toStr),
@@ -807,10 +808,8 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
block := self.CurrentBlock()
vmenv := core.NewEnv(statedb, self.backend.ChainManager(), msg, block)
- initialGas := new(big.Int).Set(msg.gas)
- res, err := vmenv.Call(msg.from, msg.to, msg.data, msg.gas, msg.gasPrice, msg.value)
-
- return common.ToHex(res), initialGas.Sub(initialGas, msg.gas).String(), err
+ res, gas, err := core.ApplyMessage(vmenv, msg, from)
+ return common.ToHex(res), gas.String(), err
}
func (self *XEth) ConfirmTransaction(tx string) bool {