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
fe90ed4a
Commit
fe90ed4a
authored
Jan 18, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rm logging statements and inline `send`
parent
d5085c4c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
13 deletions
+3
-13
bitswap.go
bitswap.go
+3
-13
No files found.
bitswap.go
View file @
fe90ed4a
...
...
@@ -168,18 +168,6 @@ func (bs *bitswap) HasBlock(ctx context.Context, blk *blocks.Block) error {
return
bs
.
network
.
Provide
(
ctx
,
blk
.
Key
())
}
func
(
bs
*
bitswap
)
sendWantlistMsgToPeer
(
ctx
context
.
Context
,
m
bsmsg
.
BitSwapMessage
,
p
peer
.
ID
)
error
{
log
:=
log
.
Prefix
(
"bitswap(%s).bitswap.sendWantlistMsgToPeer(%d, %s)"
,
bs
.
self
,
len
(
m
.
Wantlist
()),
p
)
log
.
Debug
(
"sending wantlist"
)
if
err
:=
bs
.
send
(
ctx
,
p
,
m
);
err
!=
nil
{
log
.
Errorf
(
"send wantlist error: %s"
,
err
)
return
err
}
log
.
Debugf
(
"send wantlist success"
)
return
nil
}
func
(
bs
*
bitswap
)
sendWantlistMsgToPeers
(
ctx
context
.
Context
,
m
bsmsg
.
BitSwapMessage
,
peers
<-
chan
peer
.
ID
)
error
{
if
peers
==
nil
{
panic
(
"Cant send wantlist to nil peerchan"
)
...
...
@@ -203,7 +191,9 @@ func (bs *bitswap) sendWantlistMsgToPeers(ctx context.Context, m bsmsg.BitSwapMe
wg
.
Add
(
1
)
go
func
(
p
peer
.
ID
)
{
defer
wg
.
Done
()
bs
.
sendWantlistMsgToPeer
(
ctx
,
m
,
p
)
if
err
:=
bs
.
send
(
ctx
,
p
,
m
);
err
!=
nil
{
log
.
Error
(
err
)
// TODO remove if too verbose
}
}(
peerToQuery
)
}
wg
.
Wait
()
...
...
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