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
470b02d4
Commit
470b02d4
authored
Nov 19, 2014
by
Brian Tiger Chow
Committed by
Jeromy
Dec 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(bitswap) move wantlist to loop receive
License: MIT Signed-off-by:
Brian Tiger Chow
<
brian@perfmode.com
>
parent
12b83ff8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
bitswap.go
bitswap.go
+3
-0
No files found.
bitswap.go
View file @
470b02d4
...
@@ -178,6 +178,9 @@ func (bs *bitswap) run(ctx context.Context) {
...
@@ -178,6 +178,9 @@ func (bs *bitswap) run(ctx context.Context) {
}
}
case
ks
:=
<-
bs
.
batchRequests
:
case
ks
:=
<-
bs
.
batchRequests
:
// TODO: implement batching on len(ks) > X for some X
// TODO: implement batching on len(ks) > X for some X
for
_
,
k
:=
range
ks
{
bs
.
wantlist
.
Add
(
k
)
}
if
len
(
ks
)
==
0
{
if
len
(
ks
)
==
0
{
log
.
Warning
(
"Received batch request for zero blocks"
)
log
.
Warning
(
"Received batch request for zero blocks"
)
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