From 79fa05867f78a159f4c229c21c12f0e4679b5b2e Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 15 May 2015 23:52:57 +0200 Subject: xeth: set balance max balance to from in call. Closes #951 --- common/big.go | 1 + xeth/xeth.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/big.go b/common/big.go index e8057acf6..3257b179d 100644 --- a/common/big.go +++ b/common/big.go @@ -13,6 +13,7 @@ var ( Big32 = big.NewInt(32) Big256 = big.NewInt(0xff) Big257 = big.NewInt(257) + MaxBig = String2Big("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") ) // Big pow diff --git a/xeth/xeth.go b/xeth/xeth.go index 0d16393c2..88cd30afc 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -778,7 +778,7 @@ func (self *XEth) PushTx(encodedTx string) (string, error) { } func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr string) (string, string, error) { - statedb := self.State().State() //self.eth.ChainManager().TransState() + statedb := self.State().State().Copy() //self.eth.ChainManager().TransState() var from *state.StateObject if len(fromStr) == 0 { accounts, err := self.backend.AccountManager().Accounts() @@ -791,6 +791,7 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st from = statedb.GetOrNewStateObject(common.HexToAddress(fromStr)) } + from.SetBalance(common.MaxBig) from.SetGasPool(self.backend.ChainManager().GasLimit()) msg := callmsg{ from: from, -- cgit v1.2.3