aboutsummaryrefslogtreecommitdiffstats
path: root/les/backend.go
diff options
context:
space:
mode:
Diffstat (limited to 'les/backend.go')
-rw-r--r--les/backend.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/les/backend.go b/les/backend.go
index 5670b77d2..184464f20 100644
--- a/les/backend.go
+++ b/les/backend.go
@@ -104,17 +104,17 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) {
}
eth.txPool = light.NewTxPool(eth.chainConfig, eth.eventMux, eth.blockchain, eth.relay)
- if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, config.LightMode, config.NetworkId, eth.eventMux, eth.engine, eth.blockchain, nil, chainDb, odr, relay); err != nil {
+ lightSync := config.SyncMode == downloader.LightSync
+ if eth.protocolManager, err = NewProtocolManager(eth.chainConfig, lightSync, config.NetworkId, eth.eventMux, eth.engine, eth.blockchain, nil, chainDb, odr, relay); err != nil {
return nil, err
}
relay.ps = eth.protocolManager.peers
relay.reqDist = eth.protocolManager.reqDist
eth.ApiBackend = &LesApiBackend{eth, nil}
- gpoParams := gasprice.Config{
- Blocks: config.GpoBlocks,
- Percentile: config.GpoPercentile,
- Default: config.GasPrice,
+ gpoParams := config.GPO
+ if gpoParams.Default == nil {
+ gpoParams.Default = config.GasPrice
}
eth.ApiBackend.gpo = gasprice.NewOracle(eth.ApiBackend, gpoParams)
return eth, nil