@@ -276,6 +276,7 @@ func New(stack *node.Node, config *Config) (*Cortex, error) {
276276
277277 ctxc .miner = miner .New (ctxc , & config .Miner , ctxc .chainConfig , ctxc .eventMux , ctxc .engine , ctxc .isLocalBlock )
278278 ctxc .miner .SetExtra (makeExtraData (config .Miner .ExtraData ))
279+
279280 ctxc .dropper = newDropper (ctxc .p2pServer .MaxDialedConns (), ctxc .p2pServer .MaxInboundConns ())
280281
281282 ctxc .APIBackend = & CortexAPIBackend {stack .Config ().AllowUnprotectedTxs , ctxc , nil }
@@ -287,9 +288,9 @@ func New(stack *node.Node, config *Config) (*Cortex, error) {
287288 gpoParams .Default = config .Miner .GasPrice
288289 }
289290 ctxc .APIBackend .gpo = gasprice .NewOracle (ctxc .APIBackend , gpoParams )
290- if err != nil {
291- return nil , err
292- }
291+
292+ // Start the RPC service
293+ ctxc . netRPCService = ctxcapi . NewPublicNetAPI ( ctxc . p2pServer , networkID )
293294
294295 //stack.RegisterProtocols(ctxc.Protocols())
295296
@@ -609,8 +610,7 @@ func (s *Cortex) Protocols() []p2p.Protocol {
609610
610611// Start implements node.Service, starting all internal goroutines needed by the
611612// Cortex protocol implementation.
612- func (s * Cortex ) Start (srvr * p2p.Server ) error {
613- s .startCtxcEntryUpdate (srvr .LocalNode ())
613+ func (s * Cortex ) Start () error {
614614 if err := s .setupDiscovery (); err != nil {
615615 return err
616616 }
@@ -620,13 +620,9 @@ func (s *Cortex) Start(srvr *p2p.Server) error {
620620 // Regularly update shutdown marker
621621 s .shutdownTracker .Start ()
622622
623- // Start the RPC service
624- s .netRPCService = ctxcapi .NewPublicNetAPI (srvr , s .NetVersion ())
625-
626623 // Figure out a max peers count based on the server limits
627- maxPeers := srvr .MaxPeers
628624 // Start the networking layer and the light server if requested
629- s .protocolManager .Start (maxPeers )
625+ s .protocolManager .Start (s . p2pServer . MaxPeers )
630626
631627 // Start the connection manager
632628 s .dropper .Start (s .p2pServer , func () bool { return ! s .Synced () })
@@ -697,6 +693,8 @@ func (s *Cortex) updateFilterMapsHeads() {
697693}
698694
699695func (s * Cortex ) setupDiscovery () error {
696+ s .startENRUpdater (s .p2pServer .LocalNode ())
697+
700698 dnsclient := dnsdisc .NewClient (dnsdisc.Config {})
701699 if len (s .config .DiscoveryURLs ) > 0 {
702700 iter , err := dnsclient .NewIterator (s .config .DiscoveryURLs ... )
0 commit comments