Commit e0c5c22d authored by Lars Gierth's avatar Lars Gierth
Browse files

Avoid unneccessary multiaddr resolutions

parent 0c23c968
......@@ -452,6 +452,9 @@ func (h *BasicHost) resolveAddrs(ctx context.Context, pi pstore.PeerInfo) ([]ma.
var addrs []ma.Multiaddr
for _, addr := range pi.Addrs {
addrs = append(addrs, addr)
if !madns.Matches(addr) {
continue
}
reqaddr := addr.Encapsulate(p2paddr)
resaddrs, err := h.maResolver.Resolve(ctx, reqaddr)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment