Commit b408265b authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

dht bootstrap err check fix + logging

parent f9b7a650
......@@ -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()
......
......@@ -148,7 +148,7 @@ func (dht *IpfsDHT) handleFindPeer(ctx context.Context, p peer.ID, pmes *pb.Mess
}
if closest == nil {
log.Errorf("handleFindPeer: could not find anything.")
log.Debugf("handleFindPeer: could not find anything.")
return resp, nil
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment