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
640fa135
Commit
640fa135
authored
Sep 18, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refac(bitswap) extract const
parent
55e53181
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
bitswap.go
bitswap.go
+4
-1
No files found.
bitswap.go
View file @
640fa135
...
@@ -63,9 +63,12 @@ type bitswap struct {
...
@@ -63,9 +63,12 @@ type bitswap struct {
// GetBlock attempts to retrieve a particular block from peers within the
// GetBlock attempts to retrieve a particular block from peers within the
// deadline enforced by the context
// deadline enforced by the context
//
// TODO ensure only one active request per key
func
(
bs
*
bitswap
)
Block
(
ctx
context
.
Context
,
k
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
func
(
bs
*
bitswap
)
Block
(
ctx
context
.
Context
,
k
u
.
Key
)
(
*
blocks
.
Block
,
error
)
{
provs_ch
:=
bs
.
routing
.
FindProvidersAsync
(
ctx
,
k
,
20
)
const
maxProviders
=
20
provs_ch
:=
bs
.
routing
.
FindProvidersAsync
(
ctx
,
k
,
maxProviders
)
blockChannel
:=
make
(
chan
blocks
.
Block
)
blockChannel
:=
make
(
chan
blocks
.
Block
)
...
...
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