Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5ac132e

Browse files
committedNov 23, 2015
Address CR comment
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
1 parent ad84e8b commit 5ac132e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed
 

‎exchange/bitswap/bitswap.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,6 @@ func (bs *Bitswap) GetBlocks(ctx context.Context, keys []key.Key) (<-chan *block
208208
log.Event(ctx, "Bitswap.GetBlockRequest.Start", &k)
209209
}
210210

211-
go func() {
212-
select {
213-
case <-ctx.Done(): // ctx is canceled
214-
bs.CancelWants(keys)
215-
}
216-
}()
217211
bs.wm.WantBlocks(keys)
218212

219213
req := &blockRequest{
@@ -224,6 +218,7 @@ func (bs *Bitswap) GetBlocks(ctx context.Context, keys []key.Key) (<-chan *block
224218
case bs.findKeys <- req:
225219
return promise, nil
226220
case <-ctx.Done():
221+
bs.CancelWants(keys)
227222
return nil, ctx.Err()
228223
}
229224
}

0 commit comments

Comments
 (0)
Please sign in to comment.