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
b408265b
Commit
b408265b
authored
Dec 23, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dht bootstrap err check fix + logging
parent
f9b7a650
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
dht.go
dht.go
+6
-5
handlers.go
handlers.go
+1
-1
No files found.
dht.go
View file @
b408265b
...
...
@@ -372,13 +372,14 @@ func (dht *IpfsDHT) Bootstrap(ctx context.Context) {
id
:=
make
([]
byte
,
16
)
rand
.
Read
(
id
)
pi
,
err
:=
dht
.
FindPeer
(
ctx
,
peer
.
ID
(
id
))
if
err
!=
nil
{
// NOTE: this is not an error. this is expected!
if
err
==
routing
.
ErrNotFound
{
// this isn't an error. this is precisely what we expect.
}
else
if
err
!=
nil
{
log
.
Errorf
(
"Bootstrap peer error: %s"
,
err
)
}
else
{
// woah, we got a peer under a random id? it _cannot_ be valid.
log
.
Errorf
(
"dht seemingly found a peer at a random bootstrap id (%s)..."
,
pi
)
}
// woah, we got a peer under a random id? it _cannot_ be valid.
log
.
Errorf
(
"dht seemingly found a peer at a random bootstrap id (%s)..."
,
pi
)
}()
}
wg
.
Wait
()
...
...
handlers.go
View file @
b408265b
...
...
@@ -148,7 +148,7 @@ func (dht *IpfsDHT) handleFindPeer(ctx context.Context, p peer.ID, pmes *pb.Mess
}
if
closest
==
nil
{
log
.
Error
f
(
"handleFindPeer: could not find anything."
)
log
.
Debug
f
(
"handleFindPeer: could not find anything."
)
return
resp
,
nil
}
...
...
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