Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Commit

Permalink
fix: use context.Background() instead of nil
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmc committed Aug 16, 2019
1 parent 4bb2266 commit 526e553
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bitswap.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (bs *Bitswap) GetBlocks(ctx context.Context, keys []cid.Cid) (<-chan blocks
// HasBlock announces the existence of a block to this bitswap service. The
// service will potentially notify its peers.
func (bs *Bitswap) HasBlock(blk blocks.Block) error {
return bs.receiveBlocksFrom(nil, "", []blocks.Block{blk})
return bs.receiveBlocksFrom(context.Background(), "", []blocks.Block{blk})
}

// TODO: Some of this stuff really only needs to be done when adding a block
Expand Down
4 changes: 3 additions & 1 deletion sessionmanager/sessionmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ func TestInterestedIn(t *testing.T) {
ctx := context.Background()
ctx, cancel := context.WithCancel(ctx)
defer cancel()
sm := New(ctx, sessionFactory, peerManagerFactory, requestSplitterFactory)
notif := notifications.New()
defer notif.Shutdown()
sm := New(ctx, sessionFactory, peerManagerFactory, requestSplitterFactory, notif)

blks := testutil.GenerateBlocksOfSize(4, 1024)
var cids []cid.Cid
Expand Down

0 comments on commit 526e553

Please sign in to comment.