Skip to content

Commit

Permalink
fix: resolve all addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
mrekucci committed Nov 10, 2023
1 parent d6cb66e commit 31d74a5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/p2p/libp2p/libp2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 31d74a5

Please sign in to comment.