aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2017-04-06 22:20:42 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-04-06 22:20:42 +0800
commit9aca9e6deb243b87cc75325be593a3b0c2f0a113 (patch)
tree605baeff7692446519b40118314a44a2fcb8e923 /eth/backend.go
parent0ec1104ba92c226c279389bbeb88ca515208f030 (diff)
downloadgo-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.gz
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.bz2
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.lz
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.xz
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.tar.zst
go-tangerine-9aca9e6deb243b87cc75325be593a3b0c2f0a113.zip
cmd, les, eth, eth/gasprice: using new gas price oracle (#13853)
* cmd, les, eth, eth/gasprice: using new gas price oracle * eth/gasprice: renamed source file * eth/gasprice: added security checks for gpo params * eth/gasprice: fixed naming issues * eth/gasprice: max limit, maxEmpty
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go23
1 files changed, 8 insertions, 15 deletions
diff --git a/eth/backend.go b/eth/backend.go
index af1d46a2c..f241d5f34 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -84,12 +84,8 @@ type Config struct {
MinerThreads int
SolcPath string
- GpoMinGasPrice *big.Int
- GpoMaxGasPrice *big.Int
- GpoFullBlockRatio int
- GpobaseStepDown int
- GpobaseStepUp int
- GpobaseCorrectionFactor int
+ GpoBlocks int
+ GpoPercentile int
EnablePreimageRecording bool
}
@@ -211,16 +207,13 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
eth.miner.SetGasPrice(config.GasPrice)
eth.miner.SetExtra(config.ExtraData)
- gpoParams := &gasprice.GpoParams{
- GpoMinGasPrice: config.GpoMinGasPrice,
- GpoMaxGasPrice: config.GpoMaxGasPrice,
- GpoFullBlockRatio: config.GpoFullBlockRatio,
- GpobaseStepDown: config.GpobaseStepDown,
- GpobaseStepUp: config.GpobaseStepUp,
- GpobaseCorrectionFactor: config.GpobaseCorrectionFactor,
+ eth.ApiBackend = &EthApiBackend{eth, nil}
+ gpoParams := gasprice.Config{
+ Blocks: config.GpoBlocks,
+ Percentile: config.GpoPercentile,
+ Default: config.GasPrice,
}
- gpo := gasprice.NewGasPriceOracle(eth.blockchain, chainDb, eth.eventMux, gpoParams)
- eth.ApiBackend = &EthApiBackend{eth, gpo}
+ eth.ApiBackend.gpo = gasprice.NewOracle(eth.ApiBackend, gpoParams)
return eth, nil
}