From c19e07012f9a8cb430222de64b4e77be64b40991 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Mon, 3 Jan 2022 11:52:41 +0400 Subject: [PATCH] remove direct dependency on libp2p/go-addr-util --- go.mod | 2 +- go.sum | 3 ++- p2p/host/basic/basic_host.go | 7 +++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 8774c14383..78068a6c3f 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/libp2p/go-tcp-transport v0.4.0 github.com/libp2p/go-ws-transport v0.5.0 github.com/libp2p/zeroconf/v2 v2.1.1 - github.com/multiformats/go-multiaddr v0.4.0 + github.com/multiformats/go-multiaddr v0.5.0 github.com/multiformats/go-multiaddr-dns v0.3.1 github.com/multiformats/go-multistream v0.2.2 github.com/multiformats/go-varint v0.0.6 diff --git a/go.sum b/go.sum index 3cea6c6c54..af20ed9426 100644 --- a/go.sum +++ b/go.sum @@ -608,8 +608,9 @@ github.com/multiformats/go-multiaddr v0.2.2/go.mod h1:NtfXiOtHvghW9KojvtySjH5y0u github.com/multiformats/go-multiaddr v0.3.0/go.mod h1:dF9kph9wfJ+3VLAaeBqo9Of8x4fJxp6ggJGteB8HQTI= github.com/multiformats/go-multiaddr v0.3.1/go.mod h1:uPbspcUPd5AfaP6ql3ujFY+QWzmBD8uLLL4bXW0XfGc= github.com/multiformats/go-multiaddr v0.3.3/go.mod h1:lCKNGP1EQ1eZ35Za2wlqnabm9xQkib3fyB+nZXHLag0= -github.com/multiformats/go-multiaddr v0.4.0 h1:hL/K4ZJhJ5PTw3nwylq9lGU5yArzcAroZmex1ghSEkQ= github.com/multiformats/go-multiaddr v0.4.0/go.mod h1:YcpyLH8ZPudLxQlemYBPhSm0/oCXAT8Z4mzFpyoPyRc= +github.com/multiformats/go-multiaddr v0.5.0 h1:i/JuOoVg4szYQ4YEzDGtb2h0o8M7CG/Yq6cGlcjWZpM= +github.com/multiformats/go-multiaddr v0.5.0/go.mod h1:3KAxNkUqLTJ20AAwN4XVX4kZar+bR+gh4zgbfr3SNug= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= diff --git a/p2p/host/basic/basic_host.go b/p2p/host/basic/basic_host.go index 4c3f2be6f5..9a0285e7ca 100644 --- a/p2p/host/basic/basic_host.go +++ b/p2p/host/basic/basic_host.go @@ -9,7 +9,7 @@ import ( "sync" "time" - autonat "github.com/libp2p/go-libp2p/p2p/host/autonat" + "github.com/libp2p/go-libp2p/p2p/host/autonat" "github.com/libp2p/go-libp2p/p2p/host/pstoremanager" "github.com/libp2p/go-libp2p/p2p/host/relaysvc" relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay" @@ -27,7 +27,6 @@ import ( "github.com/libp2p/go-libp2p-core/protocol" "github.com/libp2p/go-libp2p-core/record" - addrutil "github.com/libp2p/go-addr-util" "github.com/libp2p/go-eventbus" inat "github.com/libp2p/go-libp2p-nat" "github.com/libp2p/go-netroute" @@ -826,7 +825,7 @@ func (h *BasicHost) AllAddrs() []ma.Multiaddr { // Iterate over all _unresolved_ listen addresses, resolving our primary // interface only to avoid advertising too many addresses. var finalAddrs []ma.Multiaddr - if resolved, err := addrutil.ResolveUnspecifiedAddresses(listenAddrs, filteredIfaceAddrs); err != nil { + if resolved, err := manet.ResolveUnspecifiedAddresses(listenAddrs, filteredIfaceAddrs); err != nil { // This can happen if we're listening on no addrs, or listening // on IPv6 addrs, but only have IPv4 interface addrs. log.Debugw("failed to resolve listen addrs", "error", err) @@ -959,7 +958,7 @@ func (h *BasicHost) AllAddrs() []ma.Multiaddr { // No. // in case the router gives us a wrong address or we're behind a double-NAT. // also add observed addresses - resolved, err := addrutil.ResolveUnspecifiedAddress(listen, allIfaceAddrs) + resolved, err := manet.ResolveUnspecifiedAddress(listen, allIfaceAddrs) if err != nil { // This can happen if we try to resolve /ip6/::/... // without any IPv6 interface addresses.