Commit 0d81f0bd authored by Jeromy's avatar Jeromy Committed by Juan Batiz-Benet

some bugfixes and added logging

parent b016e377
...@@ -152,15 +152,14 @@ func (dht *IpfsDHT) FindProvidersAsync2(ctx context.Context, key u.Key, count in ...@@ -152,15 +152,14 @@ func (dht *IpfsDHT) FindProvidersAsync2(ctx context.Context, key u.Key, count in
peers := dht.routingTables[0].NearestPeers(kb.ConvertKey(key), AlphaValue) peers := dht.routingTables[0].NearestPeers(kb.ConvertKey(key), AlphaValue)
for _, pp := range peers { for _, pp := range peers {
ppp := pp go func(p *peer.Peer) {
go func() { pmes, err := dht.findProvidersSingle(p, key, 0, timeout)
pmes, err := dht.findProvidersSingle(ctx, ppp, key, 0)
if err != nil { if err != nil {
u.PErr("%v\n", err) u.PErr("%v\n", err)
return return
} }
dht.addPeerListAsync(key, pmes.GetProviderPeers(), ps, count, peerOut) dht.addPeerListAsync(key, pmes.GetPeers(), ps, count, peerOut)
}() }(pp)
} }
}() }()
......
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