Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
38dcf8c3
Commit
38dcf8c3
authored
Aug 16, 2019
by
Dirk McCormick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: use context.Background() instead of nil
parent
e6b35e97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
bitswap.go
bitswap.go
+1
-1
sessionmanager/sessionmanager_test.go
sessionmanager/sessionmanager_test.go
+3
-1
No files found.
bitswap.go
View file @
38dcf8c3
...
@@ -273,7 +273,7 @@ func (bs *Bitswap) GetBlocks(ctx context.Context, keys []cid.Cid) (<-chan blocks
...
@@ -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
// HasBlock announces the existence of a block to this bitswap service. The
// service will potentially notify its peers.
// service will potentially notify its peers.
func
(
bs
*
Bitswap
)
HasBlock
(
blk
blocks
.
Block
)
error
{
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
// TODO: Some of this stuff really only needs to be done when adding a block
...
...
sessionmanager/sessionmanager_test.go
View file @
38dcf8c3
...
@@ -180,7 +180,9 @@ func TestInterestedIn(t *testing.T) {
...
@@ -180,7 +180,9 @@ func TestInterestedIn(t *testing.T) {
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
defer
cancel
()
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
)
blks
:=
testutil
.
GenerateBlocksOfSize
(
4
,
1024
)
var
cids
[]
cid
.
Cid
var
cids
[]
cid
.
Cid
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment