From 9aca9e6deb243b87cc75325be593a3b0c2f0a113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felf=C3=B6ldi=20Zsolt?= Date: Thu, 6 Apr 2017 16:20:42 +0200 Subject: 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 --- les/api_backend.go | 2 +- les/backend.go | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'les') diff --git a/les/api_backend.go b/les/api_backend.go index df2782f78..67de3bcd5 100644 --- a/les/api_backend.go +++ b/les/api_backend.go @@ -38,7 +38,7 @@ import ( type LesApiBackend struct { eth *LightEthereum - gpo *gasprice.LightPriceOracle + gpo *gasprice.Oracle } func (b *LesApiBackend) ChainConfig() *params.ChainConfig { diff --git a/les/backend.go b/les/backend.go index bb08efd91..3aad16fa0 100644 --- a/les/backend.go +++ b/les/backend.go @@ -111,7 +111,12 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) { relay.reqDist = eth.protocolManager.reqDist eth.ApiBackend = &LesApiBackend{eth, nil} - eth.ApiBackend.gpo = gasprice.NewLightPriceOracle(eth.ApiBackend) + gpoParams := gasprice.Config{ + Blocks: config.GpoBlocks, + Percentile: config.GpoPercentile, + Default: config.GasPrice, + } + eth.ApiBackend.gpo = gasprice.NewOracle(eth.ApiBackend, gpoParams) return eth, nil } -- cgit v1.2.3