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
5da9c5e7
Commit
5da9c5e7
authored
Jan 11, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
early out if no entries in wantlist
parent
09a1db4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
bitswap.go
bitswap.go
+7
-1
No files found.
bitswap.go
View file @
5da9c5e7
...
...
@@ -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