ceremonyclient/go-libp2p/p2p/host/autorelay/relay.go

18 lines
338 B
Go
Raw Normal View History

2023-08-21 03:50:38 +00:00
package autorelay
import (
ma "github.com/multiformats/go-multiaddr"
)
// Filter filters out all relay addresses.
func Filter(addrs []ma.Multiaddr) []ma.Multiaddr {
raddrs := make([]ma.Multiaddr, 0, len(addrs))
for _, addr := range addrs {
if isRelayAddr(addr) {
continue
}
raddrs = append(raddrs, addr)
}
return raddrs
}