Default gas

This commit is contained in:
obscuren
2015-04-02 14:00:49 +02:00
parent 55b1c1546b
commit 1e28b424e7
3 changed files with 7 additions and 5 deletions

View File

@ -566,11 +566,11 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
}
if msg.gas.Cmp(big.NewInt(0)) == 0 {
msg.gas = self.DefaultGas()
msg.gas = DefaultGas()
}
if msg.gasPrice.Cmp(big.NewInt(0)) == 0 {
msg.gasPrice = self.DefaultGasPrice()
msg.gasPrice = DefaultGasPrice()
}
block := self.CurrentBlock()
@ -616,11 +616,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 = self.DefaultGas()
gas = DefaultGas()
}
if price.Cmp(big.NewInt(0)) == 0 {
price = self.DefaultGasPrice()
price = DefaultGasPrice()
}
data = common.FromHex(codeStr)