diff --git a/score.go b/score.go index 3af67a6..a912f1d 100644 --- a/score.go +++ b/score.go @@ -761,7 +761,7 @@ func (ps *peerScore) getIPs(p peer.ID) []string { } conns := ps.host.Network().ConnsToPeer(p) - res := make([]string, 0, len(conns)) + res := make([]string, 0, 1) for _, c := range conns { remote := c.RemoteMultiaddr() ip, err := manet.ToIP(remote) @@ -769,6 +769,12 @@ func (ps *peerScore) getIPs(p peer.ID) []string { continue } + // ignore those; loopback for unit testing and unspecific because gremlins in testground + // give us an unspecific IP6 conns everywhere! + if ip.IsUnspecified() || ip.IsLoopback() { + continue + } + if len(ip) == 4 { // IPv4 address ip4 := ip.String()