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
4b4834e5
Commit
4b4834e5
authored
Sep 19, 2014
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refac(bitswap) nil slices are 'range'able
parent
554b5a49
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
22 deletions
+18
-22
bitswap.go
bitswap.go
+18
-22
No files found.
bitswap.go
View file @
4b4834e5
...
...
@@ -117,7 +117,6 @@ func (bs *bitswap) ReceiveMessage(
bs
.
strategy
.
MessageReceived
(
p
,
incoming
)
if
incoming
.
Blocks
()
!=
nil
{
for
_
,
block
:=
range
incoming
.
Blocks
()
{
err
:=
bs
.
blockstore
.
Put
(
block
)
// FIXME(brian): err ignored
if
err
!=
nil
{
...
...
@@ -129,9 +128,7 @@ func (bs *bitswap) ReceiveMessage(
return
nil
,
nil
,
err
}
}
}
if
incoming
.
Wantlist
()
!=
nil
{
for
_
,
key
:=
range
incoming
.
Wantlist
()
{
if
bs
.
strategy
.
ShouldSendBlockToPeer
(
key
,
p
)
{
block
,
errBlockNotFound
:=
bs
.
blockstore
.
Get
(
key
)
...
...
@@ -144,7 +141,6 @@ func (bs *bitswap) ReceiveMessage(
return
p
,
message
,
nil
}
}
}
return
nil
,
nil
,
nil
}
...
...
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