Commit 3696041f authored by Juan Batiz-Benet's avatar Juan Batiz-Benet Committed by Brian Tiger Chow

Routing uses context now

@perfmode boom
parent 1aaa88fa
...@@ -103,7 +103,7 @@ func (bs *bitswap) Block(parent context.Context, k u.Key) (*blocks.Block, error) ...@@ -103,7 +103,7 @@ func (bs *bitswap) Block(parent context.Context, k u.Key) (*blocks.Block, error)
// it to peers (Partners) whose WantLists include it. // it to peers (Partners) whose WantLists include it.
func (bs *bitswap) HasBlock(ctx context.Context, blk blocks.Block) error { func (bs *bitswap) HasBlock(ctx context.Context, blk blocks.Block) error {
bs.sendToPeersThatWant(ctx, blk) bs.sendToPeersThatWant(ctx, blk)
return bs.routing.Provide(blk.Key()) return bs.routing.Provide(ctx, blk.Key())
} }
// TODO(brian): handle errors // TODO(brian): handle errors
......
...@@ -49,5 +49,5 @@ type Routing interface { ...@@ -49,5 +49,5 @@ type Routing interface {
FindProvidersAsync(context.Context, u.Key, int) <-chan *peer.Peer FindProvidersAsync(context.Context, u.Key, int) <-chan *peer.Peer
// Provide provides the key to the network // Provide provides the key to the network
Provide(key u.Key) error Provide(context.Context, u.Key) error
} }
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