aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-01 19:25:15 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-01 19:25:15 +0800
commit936ddf2ad1b7306dfe7f5ae9ca122a4968dd98e8 (patch)
tree199c084804826fda0fd9e915706c703860e5a338
parentdba9b83aa07ced653b24c3e34d55ffe13a740243 (diff)
parent1559bd9e1bce8c5fcc947a1aee778da7446b251b (diff)
downloaddexon-936ddf2ad1b7306dfe7f5ae9ca122a4968dd98e8.tar.gz
dexon-936ddf2ad1b7306dfe7f5ae9ca122a4968dd98e8.tar.zst
dexon-936ddf2ad1b7306dfe7f5ae9ca122a4968dd98e8.zip
Merge pull request #616 from bas-vk/develop
Frontier/513
-rw-r--r--xeth/xeth.go13
1 files changed, 7 insertions, 6 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 33fda9b4b..5a5a4650a 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -129,8 +129,8 @@ func cTopics(t [][]string) [][]common.Hash {
return topics
}
-func (self *XEth) DefaultGas() *big.Int { return defaultGas }
-func (self *XEth) DefaultGasPrice() *big.Int { return defaultGasPrice }
+func (self *XEth) DefaultGas() *big.Int { return new(big.Int).Set(defaultGas) }
+func (self *XEth) DefaultGasPrice() *big.Int { return new(big.Int).Set(defaultGasPrice) }
func (self *XEth) RemoteMining() *miner.RemoteAgent { return self.agent }
@@ -565,12 +565,13 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
value: common.Big(valueStr),
data: common.FromHex(dataStr),
}
+
if msg.gas.Cmp(big.NewInt(0)) == 0 {
- msg.gas = defaultGas
+ msg.gas = self.DefaultGas()
}
if msg.gasPrice.Cmp(big.NewInt(0)) == 0 {
- msg.gasPrice = defaultGasPrice
+ msg.gasPrice = self.DefaultGasPrice()
}
block := self.CurrentBlock()
@@ -616,11 +617,11 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt
// TODO: align default values to have the same type, e.g. not depend on
// common.Value conversions later on
if gas.Cmp(big.NewInt(0)) == 0 {
- gas = defaultGas
+ gas = self.DefaultGas()
}
if price.Cmp(big.NewInt(0)) == 0 {
- price = defaultGasPrice
+ price = self.DefaultGasPrice()
}
data = common.FromHex(codeStr)