Commit 99d72bcd authored by Brian Tiger Chow's avatar Brian Tiger Chow

refac(routing) replace timeout -> ctx

@jbenet oh hai there!
parent 34e171e2
...@@ -121,9 +121,7 @@ func (dht *IpfsDHT) Provide(key u.Key) error { ...@@ -121,9 +121,7 @@ func (dht *IpfsDHT) Provide(key u.Key) error {
} }
// FindProvidersAsync runs FindProviders and sends back results over a channel // FindProvidersAsync runs FindProviders and sends back results over a channel
func (dht *IpfsDHT) FindProvidersAsync(key u.Key, count int, timeout time.Duration) <-chan *peer.Peer { func (dht *IpfsDHT) FindProvidersAsync(ctx context.Context, key u.Key, count int) <-chan *peer.Peer {
ctx, _ := context.WithTimeout(context.TODO(), timeout)
peerOut := make(chan *peer.Peer, count) peerOut := make(chan *peer.Peer, count)
go func() { go func() {
ps := newPeerSet() ps := newPeerSet()
......
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