Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-kad-dht
Commits
1290c4ef
Commit
1290c4ef
authored
Jun 06, 2018
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better check for connectedness
parent
2a5314f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
query.go
query.go
+4
-1
No files found.
query.go
View file @
1290c4ef
...
...
@@ -14,6 +14,7 @@ import (
todoctr
"github.com/ipfs/go-todocounter"
process
"github.com/jbenet/goprocess"
ctxproc
"github.com/jbenet/goprocess/context"
inet
"github.com/libp2p/go-libp2p-net"
peer
"github.com/libp2p/go-libp2p-peer"
pset
"github.com/libp2p/go-libp2p-peer/peerset"
pstore
"github.com/libp2p/go-libp2p-peerstore"
...
...
@@ -236,7 +237,9 @@ func (r *dhtQueryRunner) queryPeer(proc process.Process, p peer.ID) {
// make sure we're connected to the peer.
// FIXME abstract away into the network layer
if
conns
:=
r
.
query
.
dht
.
host
.
Network
()
.
ConnsToPeer
(
p
);
len
(
conns
)
==
0
{
// Note: Failure to connect in this block will cause the function to
// short circuit.
if
r
.
query
.
dht
.
host
.
Network
()
.
Connectedness
(
p
)
==
inet
.
NotConnected
{
log
.
Debug
(
"not connected. dialing."
)
notif
.
PublishQueryEvent
(
r
.
runCtx
,
&
notif
.
QueryEvent
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment