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-unixfs
Commits
a09854db
Commit
a09854db
authored
Jan 11, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
early out if no entries in wantlist
parent
456719ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
exchange/bitswap/bitswap.go
exchange/bitswap/bitswap.go
+7
-1
No files found.
exchange/bitswap/bitswap.go
View file @
a09854db
...
...
@@ -225,6 +225,12 @@ func (bs *bitswap) sendWantlistToPeers(ctx context.Context, peers <-chan peer.ID
}
func
(
bs
*
bitswap
)
sendWantlistToProviders
(
ctx
context
.
Context
)
{
entries
:=
bs
.
wantlist
.
Entries
()
if
len
(
entries
)
==
0
{
log
.
Debug
(
"No entries in wantlist, skipping send routine."
)
return
}
log
:=
log
.
Prefix
(
"bitswap(%s).sendWantlistToProviders "
,
bs
.
self
)
log
.
Debugf
(
"begin"
)
defer
log
.
Debugf
(
"end"
)
...
...
@@ -237,7 +243,7 @@ func (bs *bitswap) sendWantlistToProviders(ctx context.Context) {
// Get providers for all entries in wantlist (could take a while)
wg
:=
sync
.
WaitGroup
{}
for
_
,
e
:=
range
bs
.
wantlist
.
E
ntries
()
{
for
_
,
e
:=
range
e
ntries
{
wg
.
Add
(
1
)
go
func
(
k
u
.
Key
)
{
defer
wg
.
Done
()
...
...
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