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
9c0fe130
Commit
9c0fe130
authored
Jan 22, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement dht findprovs and add error output to dht query
parent
356dcff8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
lookup.go
lookup.go
+0
-1
query.go
query.go
+7
-0
No files found.
lookup.go
View file @
9c0fe130
...
...
@@ -67,7 +67,6 @@ func (dht *IpfsDHT) GetClosestPeers(ctx context.Context, key u.Key) (<-chan peer
filtered
=
append
(
filtered
,
dht
.
peerstore
.
PeerInfo
(
clp
))
}
}
log
.
Errorf
(
"filtered: %v"
,
filtered
)
// For DHT query command
notif
.
PublishQueryEvent
(
ctx
,
&
notif
.
QueryEvent
{
...
...
query.go
View file @
9c0fe130
...
...
@@ -3,6 +3,7 @@ package dht
import
(
"sync"
notif
"github.com/jbenet/go-ipfs/notifications"
peer
"github.com/jbenet/go-ipfs/p2p/peer"
queue
"github.com/jbenet/go-ipfs/p2p/peer/queue"
"github.com/jbenet/go-ipfs/routing"
...
...
@@ -230,6 +231,12 @@ func (r *dhtQueryRunner) queryPeer(cg ctxgroup.ContextGroup, p peer.ID) {
pi
:=
peer
.
PeerInfo
{
ID
:
p
}
if
err
:=
r
.
query
.
dht
.
host
.
Connect
(
cg
.
Context
(),
pi
);
err
!=
nil
{
log
.
Debugf
(
"Error connecting: %s"
,
err
)
notif
.
PublishQueryEvent
(
cg
.
Context
(),
&
notif
.
QueryEvent
{
Type
:
notif
.
QueryError
,
Extra
:
err
.
Error
(),
})
r
.
Lock
()
r
.
errs
=
append
(
r
.
errs
,
err
)
r
.
Unlock
()
...
...
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