From b038ec08d98aabca2125cffe37b54dfadddd29a3 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 31 May 2024 00:17:16 +0200 Subject: [PATCH] p2p/netutil: fix --- p2p/netutil/net.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/p2p/netutil/net.go b/p2p/netutil/net.go index 85c62cf5d4..560c68e168 100644 --- a/p2p/netutil/net.go +++ b/p2p/netutil/net.go @@ -290,11 +290,7 @@ func (s *DistinctNetSet) RemoveAddr(ip netip.Addr) { // Contains whether the given IP is contained in the set. func (s DistinctNetSet) Contains(ip net.IP) bool { - addr, ok := netip.AddrFromSlice(ip) - if !ok { - panic(fmt.Errorf("invalid IP %v", ip)) - } - return s.ContainsAddr(addr) + return s.ContainsAddr(IPToAddr(ip)) } // Contains whether the given IP is contained in the set.