diff --git a/p2p/netutil/net.go b/p2p/netutil/net.go index 656abb682..d5da3c694 100644 --- a/p2p/netutil/net.go +++ b/p2p/netutil/net.go @@ -212,7 +212,7 @@ func sameNet(bits uint, ip, other net.IP) bool { if mask != 0 && nb < len(ip) && ip[nb]&mask != other[nb]&mask { return false } - return nb <= len(ip) && bytes.Equal(ip[:nb], other[:nb]) + return nb <= len(ip) && ip[:nb].Equal(other[:nb]) } // DistinctNetSet tracks IPs, ensuring that at most N of them