fix(bitswap/loop) add to wantlist just once

oops

set Add is idempotent but it's a waste of resources

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
feat(bitswap) find providers for all keys on wantlist

@jbenet @whyrusleeping

this addresses a failure case where

1) bitswap wants blocks A and B
2) partner 1 has A and partner 2 has B
3) We choose a key at random, drawing A.
4) Then, we request A, neglecting to find a provider for B.

Sending the full wantlist is meant to be used as a helpful additional
piece of data, but...

unless our hunch is support by statistical inference at runtime,
it's not safe to assume that a peer will have blocks for related keys.
Routing must be the source of truth.

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
feat(bitswap) loop over all provided keys

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
style(bitswap) name -> loop

eh?

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
fix(bitswap) signal termination to async'ly spawned workers

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
fix(exchange) allow exchange to be closed

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>