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
709075f7
Commit
709075f7
authored
Nov 18, 2014
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dont panic on empty wantlist
parent
fefe7d37
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
bitswap.go
bitswap.go
+5
-1
No files found.
bitswap.go
View file @
709075f7
...
...
@@ -163,9 +163,13 @@ func (bs *bitswap) run(ctx context.Context) {
for
{
select
{
case
<-
timeout
:
wantlist
:=
bs
.
wantlist
.
Keys
()
if
len
(
wantlist
)
==
0
{
continue
}
if
sendlist
==
nil
{
// rely on semi randomness of maps
firstKey
:=
bs
.
wantlist
.
Keys
()
[
0
]
firstKey
:=
wantlist
[
0
]
sendlist
=
bs
.
routing
.
FindProvidersAsync
(
ctx
,
firstKey
,
6
)
}
err
:=
bs
.
sendWantListTo
(
ctx
,
sendlist
)
...
...
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