diff --git a/query.go b/query.go index f7e10e9b..84c9e01c 100644 --- a/query.go +++ b/query.go @@ -8,6 +8,7 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p/core/peer" pstore "github.com/libp2p/go-libp2p/core/peerstore" "github.com/libp2p/go-libp2p/core/routing" @@ -529,7 +530,7 @@ func (dht *IpfsDHT) dialPeer(ctx context.Context, p peer.ID) error { defer span.End() // short-circuit if we're already connected. - if HasValidConnectedness(dht.host, p) { + if dht.host.Network().Connectedness(p) == network.Connected { return nil }