mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-24 14:22:13 +00:00
small logs
This commit is contained in:
parent
6d054da74a
commit
1c9133895e
@ -68,6 +68,7 @@ func multihashLoggableKey(mh multihash.Multihash) logging.LoggableMap {
|
||||
// Kademlia 'node lookup' operation. Returns a channel of the K closest peers
|
||||
// to the given key
|
||||
func (dht *IpfsDHT) GetClosestPeers(ctx context.Context, key string) (<-chan peer.ID, error) {
|
||||
fmt.Printf("get closest peer for: %s\n", key)
|
||||
e := logger.EventBegin(ctx, "getClosestPeers", loggableKey(key))
|
||||
tablepeers := dht.routingTable.NearestPeers(kb.ConvertKey(key), AlphaValue)
|
||||
if len(tablepeers) == 0 {
|
||||
|
@ -320,6 +320,7 @@ func (dht *IpfsDHT) getValues(ctx context.Context, key string, nvals int) (<-cha
|
||||
|
||||
// get closest peers in the routing table
|
||||
rtp := dht.routingTable.NearestPeers(kb.ConvertKey(key), AlphaValue)
|
||||
fmt.Printf("nearest peers on getValues: %s", rtp)
|
||||
logger.Debugf("peers in rt: %d %s", len(rtp), rtp)
|
||||
if len(rtp) == 0 {
|
||||
logger.Warning("No peers from routing table!")
|
||||
|
Loading…
x
Reference in New Issue
Block a user