aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-12 00:36:35 +0800
committerobscuren <geffobscura@gmail.com>2015-03-12 00:36:35 +0800
commitc01d4c2f4c8704656e407ab4d80d9ec82e016731 (patch)
treec4abc2c2260a674cd14dc6b53af15ef9b634571d /xeth/xeth.go
parent2da7af4ba0913acc74c554422a04958f3f8d78b9 (diff)
downloadgo-tangerine-c01d4c2f4c8704656e407ab4d80d9ec82e016731.tar.gz
go-tangerine-c01d4c2f4c8704656e407ab4d80d9ec82e016731.tar.zst
go-tangerine-c01d4c2f4c8704656e407ab4d80d9ec82e016731.zip
Lowered default gas price and increased default gas limit
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go20
1 files changed, 13 insertions, 7 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 891a1e072..d8dd66aec 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -293,14 +293,12 @@ func (self *XEth) PushTx(encodedTx string) (string, error) {
return toHex(tx.Hash()), nil
}
-func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr string) (string, error) {
- if len(gasStr) == 0 {
- gasStr = "100000"
- }
- if len(gasPriceStr) == 0 {
- gasPriceStr = "1"
- }
+var (
+ defaultGasPrice = big.NewInt(10000000000000)
+ defaultGas = big.NewInt(90000)
+)
+func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr string) (string, error) {
statedb := self.State().State() //self.chainManager.TransState()
msg := callmsg{
from: statedb.GetOrNewStateObject(fromHex(fromStr)),
@@ -310,6 +308,14 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
value: ethutil.Big(valueStr),
data: fromHex(dataStr),
}
+ if msg.gas.Cmp(big.NewInt(0)) == 0 {
+ msg.gas = defaultGas
+ }
+
+ if msg.gasPrice.Cmp(big.NewInt(0)) == 0 {
+ msg.gasPrice = defaultGasPrice
+ }
+
block := self.chainManager.CurrentBlock()
vmenv := core.NewEnv(statedb, self.chainManager, msg, block)