@cryptotaxi247 / kubo / commits / 7e4050302

dont potentially kill our memory

Jeromy committed Feb 21, 2015 at 19:26 UTC 7e4050302078b25da44622df280c7ad02f917101
1 file changed +2 -3
routing/dht/routing.go
+2 -3
@@ -1,7 +1,6 @@
1 package dht
2
3 import (
4 - "math"
4 "sync"
5 "time"
6
@@ -89,7 +88,7 @@ func (dht *IpfsDHT) GetValue(ctx context.Context, key u.Key) ([]byte, error) {
88
89 // get closest peers in the routing table
90 rtp := dht.routingTable.ListPeers()
92 - log.Debugf("peers in rt: %s", len(rtp), rtp)
91 + log.Errorf("peers in rt: %s", len(rtp), rtp)
92 if len(rtp) == 0 {
93 log.Warning("No peers from routing table!")
94 return nil, errors.Wrap(kb.ErrLookupFailure)
@@ -169,7 +168,7 @@ func (dht *IpfsDHT) Provide(ctx context.Context, key u.Key) error {
168 // FindProviders searches until the context expires.
169 func (dht *IpfsDHT) FindProviders(ctx context.Context, key u.Key) ([]peer.PeerInfo, error) {
170 var providers []peer.PeerInfo
172 - for p := range dht.FindProvidersAsync(ctx, key, math.MaxInt32) {
171 + for p := range dht.FindProvidersAsync(ctx, key, KValue) {
172 providers = append(providers, p)
173 }
174 return providers, nil