Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
awskii committed Jan 17, 2025
1 parent 0a29f1f commit edcca44
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions cl/sentinel/sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,12 @@ func (s *Sentinel) createListener() (*discover.UDPv5, error) {
return nil, fmt.Errorf("bad ip address provided, %s was provided", ipAddr)
}

var bindIP net.IP
var networkVersion string

bindIP, networkVersion := net.IPv4(127, 0, 0, 1), "udp4"

Check failure on line 155 in cl/sentinel/sentinel.go

View workflow job for this annotation

GitHub Actions / lint

ineffectual assignment to bindIP (ineffassign)
// If the IP is an IPv4 address, bind to the correct zero address.
if ip.To4() != nil {
// bindIP = net.IPv4zero
bindIP = ip.To4()
networkVersion = "udp4"
bindIP, networkVersion = ip.To4(), "udp4"
} else {
// bindIP = net.IPv6zero
bindIP = ip.To16()
networkVersion = "udp6"
bindIP, networkVersion = ip.To16(), "udp6"
}

udpAddr := &net.UDPAddr{
Expand All @@ -174,21 +168,17 @@ func (s *Sentinel) createListener() (*discover.UDPv5, error) {
if err != nil {
return nil, err
}
s.logger.Info("[Sentinel] Listening for UDP packets", "at", udpAddr.String())

localNode, err := s.createLocalNode(discCfg.PrivateKey, ip, port, int(s.cfg.TCPPort), s.cfg.TmpDir)
if err != nil {
return nil, err
}

// Start stream handlers

net, err := discover.ListenV5(s.ctx, "any", conn, localNode, discCfg)
if err != nil {
s.logger.Error("[Sentinel] failed Listening for TCP packets", "err", err)
return nil, err
}
s.logger.Info("[Sentinel] Listening for TCP packets", "addr", net.Self().String())

handlers.NewConsensusHandlers(s.ctx, s.blockReader, s.indiciesDB, s.host, s.peers, s.cfg.NetworkConfig, localNode, s.cfg.BeaconConfig, s.ethClock, s.handshaker, s.forkChoiceReader, s.blobStorage, s.cfg.EnableBlocks).Start()

Expand Down

0 comments on commit edcca44

Please sign in to comment.