diff --git a/pkg/p2p/libp2p/libp2p.go b/pkg/p2p/libp2p/libp2p.go index 9f3ce012558..faa0e20b0af 100644 --- a/pkg/p2p/libp2p/libp2p.go +++ b/pkg/p2p/libp2p/libp2p.go @@ -661,12 +661,14 @@ func (s *Service) Addresses() (addreses []ma.Multiaddr, err error) { addreses = append(addreses, a) } - if s.natAddrResolver != nil && len(addreses) > 0 { - a, err := s.natAddrResolver.Resolve(addreses[0]) - if err != nil { - return nil, err + if s.natAddrResolver != nil { + for _, addr := range addreses { + a, err := s.natAddrResolver.Resolve(addr) + if err != nil { + return nil, err + } + addreses = append(addreses, a) } - addreses = append(addreses, a) } return addreses, nil