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
3c044d23
Commit
3c044d23
authored
Jan 20, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass as param
parent
8e6e2db9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
bitswap.go
bitswap.go
+5
-7
No files found.
bitswap.go
View file @
3c044d23
...
...
@@ -199,12 +199,7 @@ func (bs *bitswap) sendWantlistToPeers(ctx context.Context, peers <-chan peer.ID
return
bs
.
sendWantlistMsgToPeers
(
ctx
,
message
,
peers
)
}
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
}
func
(
bs
*
bitswap
)
sendWantlistToProviders
(
ctx
context
.
Context
,
entries
[]
wantlist
.
Entry
)
{
ctx
,
cancel
:=
context
.
WithCancel
(
ctx
)
defer
cancel
()
...
...
@@ -268,7 +263,10 @@ func (bs *bitswap) clientWorker(parent context.Context) {
for
{
select
{
case
<-
broadcastSignal
:
// resend unfulfilled wantlist keys
bs
.
sendWantlistToProviders
(
ctx
)
entries
:=
bs
.
wantlist
.
Entries
()
if
len
(
entries
)
>
0
{
bs
.
sendWantlistToProviders
(
ctx
,
entries
)
}
broadcastSignal
=
time
.
After
(
rebroadcastDelay
.
Get
())
case
keys
:=
<-
bs
.
batchRequests
:
if
len
(
keys
)
==
0
{
...
...
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