Skip to content

Commit a1bc0e3

Browse files
jgimenofjl
authored andcommitted
eth: refactor creation of EthAPIBackend (#20476)
1 parent a013f02 commit a1bc0e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eth/backend.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,12 +213,12 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
213213
eth.miner = miner.New(eth, &config.Miner, chainConfig, eth.EventMux(), eth.engine, eth.isLocalBlock)
214214
eth.miner.SetExtra(makeExtraData(config.Miner.ExtraData))
215215

216-
eth.APIBackend = &EthAPIBackend{ctx.ExtRPCEnabled(), eth, nil}
217216
gpoParams := config.GPO
218217
if gpoParams.Default == nil {
219218
gpoParams.Default = config.Miner.GasPrice
220219
}
221-
eth.APIBackend.gpo = gasprice.NewOracle(eth.APIBackend, gpoParams)
220+
221+
eth.APIBackend = &EthAPIBackend{ctx.ExtRPCEnabled(), eth, gasprice.NewOracle(eth.APIBackend, gpoParams)}
222222

223223
return eth, nil
224224
}

0 commit comments

Comments
 (0)