p2p/netutil: fix

This commit is contained in:
Felix Lange 2024-05-31 00:17:16 +02:00
parent 276253326d
commit b038ec08d9

View file

@ -290,11 +290,7 @@ func (s *DistinctNetSet) RemoveAddr(ip netip.Addr) {
// Contains whether the given IP is contained in the set. // Contains whether the given IP is contained in the set.
func (s DistinctNetSet) Contains(ip net.IP) bool { func (s DistinctNetSet) Contains(ip net.IP) bool {
addr, ok := netip.AddrFromSlice(ip) return s.ContainsAddr(IPToAddr(ip))
if !ok {
panic(fmt.Errorf("invalid IP %v", ip))
}
return s.ContainsAddr(addr)
} }
// Contains whether the given IP is contained in the set. // Contains whether the given IP is contained in the set.