diff options
author | zsfelfoldi <zsfelfoldi@gmail.com> | 2015-06-12 19:57:30 +0800 |
---|---|---|
committer | zsfelfoldi <zsfelfoldi@gmail.com> | 2015-06-15 21:55:39 +0800 |
commit | 610adfd83f14652ba08d99fb098d1d62123abd38 (patch) | |
tree | fceecf9b6cdc8d53d4d3a02dc7e7d1eb56cd068b | |
parent | 3c7b64ce20aefeae6728d09d96b34ef31bc405ac (diff) | |
download | dexon-610adfd83f14652ba08d99fb098d1d62123abd38.tar dexon-610adfd83f14652ba08d99fb098d1d62123abd38.tar.gz dexon-610adfd83f14652ba08d99fb098d1d62123abd38.tar.bz2 dexon-610adfd83f14652ba08d99fb098d1d62123abd38.tar.lz dexon-610adfd83f14652ba08d99fb098d1d62123abd38.tar.xz dexon-610adfd83f14652ba08d99fb098d1d62123abd38.tar.zst dexon-610adfd83f14652ba08d99fb098d1d62123abd38.zip |
fixed xeth.gpo = nil bug
-rw-r--r-- | xeth/xeth.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 1044b02f6..71753d6bd 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -42,6 +42,9 @@ const ( func DefaultGas() *big.Int { return new(big.Int).Set(defaultGas) } func (self *XEth) DefaultGasPrice() *big.Int { + if self.gpo == nil { + self.gpo = eth.NewGasPriceOracle(self.backend) + } return self.gpo.SuggestPrice() } @@ -96,7 +99,6 @@ func New(ethereum *eth.Ethereum, frontend Frontend) *XEth { transactionQueue: make(map[int]*hashQueue), messages: make(map[int]*whisperFilter), agent: miner.NewRemoteAgent(), - gpo: eth.NewGasPriceOracle(ethereum), } if ethereum.Whisper() != nil { xeth.whisper = NewWhisper(ethereum.Whisper()) @@ -233,6 +235,7 @@ func (self *XEth) WithState(statedb *state.StateDB) *XEth { xeth := &XEth{ backend: self.backend, frontend: self.frontend, + gpo: self.gpo, } xeth.state = NewState(xeth, statedb) |