Skip to content

Commit

Permalink
fix: use a non-limited connection for querying
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Aug 19, 2024
1 parent be9a8e7 commit 7004c77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 7004c77

Please sign in to comment.