small logs

This commit is contained in:
DieMyst 2020-04-01 17:53:33 +03:00
parent 6d054da74a
commit 1c9133895e
2 changed files with 2 additions and 0 deletions

View File

@ -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 {

View File

@ -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!")