Skip to content

Commit

Permalink
fix: only warn DNS if multiple addresses in reponse
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Feb 28, 2023
1 parent ac4feb3 commit ef27909
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libp2p/network/url_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,11 @@ func getPeerIP(hostname string) (net.IP, error) {
}
// TECHDEBT: remove this log line once direction is clearer
// on supporting multiple network addresses per peer.
logger.Global.Warn().
Array("resolved", newStringLogArrayMarshaler(addrs)).
IPAddr("using", peerIP)
if len(addrs) > 1 {
logger.Global.Warn().
Array("resolved", newStringLogArrayMarshaler(addrs)).
IPAddr("using", peerIP)
}
return peerIP, nil
}
return nil, newResolvePeerIPErr(hostname, err)
Expand Down

0 comments on commit ef27909

Please sign in to comment.