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-dms3
Commits
49684ea4
Commit
49684ea4
authored
Oct 27, 2015
by
Juan Benet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1890 from ipfs/fix/bitswapLogging
bitswap: clean log printf and humanize dup data count
parents
fff95d6f
aeeed0c7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
core/commands/bitswap.go
core/commands/bitswap.go
+3
-1
exchange/bitswap/bitswap.go
exchange/bitswap/bitswap.go
+1
-1
No files found.
core/commands/bitswap.go
View file @
49684ea4
...
...
@@ -5,6 +5,8 @@ import (
"fmt"
"io"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize"
key
"github.com/ipfs/go-ipfs/blocks/key"
cmds
"github.com/ipfs/go-ipfs/commands"
bitswap
"github.com/ipfs/go-ipfs/exchange/bitswap"
...
...
@@ -156,7 +158,7 @@ var bitswapStatCmd = &cmds.Command{
fmt
.
Fprintf
(
buf
,
"
\t
provides buffer: %d / %d
\n
"
,
out
.
ProvideBufLen
,
bitswap
.
HasBlockBufferSize
)
fmt
.
Fprintf
(
buf
,
"
\t
blocks received: %d
\n
"
,
out
.
BlocksReceived
)
fmt
.
Fprintf
(
buf
,
"
\t
dup blocks received: %d
\n
"
,
out
.
DupBlksReceived
)
fmt
.
Fprintf
(
buf
,
"
\t
dup data received: %
d
\n
"
,
out
.
DupDataReceived
)
fmt
.
Fprintf
(
buf
,
"
\t
dup data received: %
s
\n
"
,
humanize
.
Bytes
(
out
.
DupDataReceived
)
)
fmt
.
Fprintf
(
buf
,
"
\t
wantlist [%d keys]
\n
"
,
len
(
out
.
Wantlist
))
for
_
,
k
:=
range
out
.
Wantlist
{
fmt
.
Fprintf
(
buf
,
"
\t\t
%s
\n
"
,
k
.
B58String
())
...
...
exchange/bitswap/bitswap.go
View file @
49684ea4
...
...
@@ -308,7 +308,7 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
var
keys
[]
key
.
Key
for
_
,
block
:=
range
iblocks
{
if
_
,
found
:=
bs
.
wm
.
wl
.
Contains
(
block
.
Key
());
!
found
{
log
.
Info
(
"received un-asked-for
block:
%s"
,
block
)
log
.
Info
f
(
"received un-asked-for
%s from
%s"
,
block
,
p
)
continue
}
keys
=
append
(
keys
,
block
.
Key
())
...
...
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