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
44f32138
Commit
44f32138
authored
Nov 19, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests halting
parent
c6af3fe4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
bitswap.go
bitswap.go
+4
-0
No files found.
bitswap.go
View file @
44f32138
...
@@ -117,6 +117,9 @@ func (bs *bitswap) GetBlocks(parent context.Context, ks []u.Key) (*blocks.Block,
...
@@ -117,6 +117,9 @@ func (bs *bitswap) GetBlocks(parent context.Context, ks []u.Key) (*blocks.Block,
}
}
func
(
bs
*
bitswap
)
sendWantListTo
(
ctx
context
.
Context
,
peers
<-
chan
peer
.
Peer
)
error
{
func
(
bs
*
bitswap
)
sendWantListTo
(
ctx
context
.
Context
,
peers
<-
chan
peer
.
Peer
)
error
{
if
peers
==
nil
{
panic
(
"Cant send wantlist to nil peerchan"
)
}
message
:=
bsmsg
.
New
()
message
:=
bsmsg
.
New
()
for
_
,
wanted
:=
range
bs
.
wantlist
.
Keys
()
{
for
_
,
wanted
:=
range
bs
.
wantlist
.
Keys
()
{
message
.
AddWanted
(
wanted
)
message
.
AddWanted
(
wanted
)
...
@@ -164,6 +167,7 @@ func (bs *bitswap) run(ctx context.Context) {
...
@@ -164,6 +167,7 @@ func (bs *bitswap) run(ctx context.Context) {
for
{
for
{
select
{
select
{
case
<-
broadcastSignal
:
case
<-
broadcastSignal
:
unsentKeys
=
0
wantlist
:=
bs
.
wantlist
.
Keys
()
wantlist
:=
bs
.
wantlist
.
Keys
()
if
len
(
wantlist
)
==
0
{
if
len
(
wantlist
)
==
0
{
continue
continue
...
...
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