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
9093b83c
Commit
9093b83c
authored
Oct 04, 2018
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid allocating for a simple debug message
Wantlist/Blocks *copy*.
parent
243a6c53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
decision/engine.go
decision/engine.go
+3
-3
No files found.
decision/engine.go
View file @
9093b83c
...
...
@@ -222,7 +222,7 @@ func (e *Engine) Peers() []peer.ID {
// MessageReceived performs book-keeping. Returns error if passed invalid
// arguments.
func
(
e
*
Engine
)
MessageReceived
(
p
peer
.
ID
,
m
bsmsg
.
BitSwapMessage
)
error
{
if
len
(
m
.
Wantlist
())
==
0
&&
len
(
m
.
Blocks
())
==
0
{
if
m
.
Empty
()
{
log
.
Debugf
(
"received empty message from %s"
,
p
)
}
...
...
@@ -257,9 +257,9 @@ func (e *Engine) MessageReceived(p peer.ID, m bsmsg.BitSwapMessage) error {
}
log
.
Error
(
err
)
}
else
{
// we have the block
// we have the block
newWorkExists
=
true
if
msgSize
+
blockSize
>
maxMessageSize
{
if
msgSize
+
blockSize
>
maxMessageSize
{
e
.
peerRequestQueue
.
Push
(
p
,
activeEntries
...
)
activeEntries
=
[]
*
wl
.
Entry
{}
msgSize
=
0
...
...
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