mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-27 07:57:30 +08:00
bitswap: log superfluous messages
This commit is contained in:
@ -149,9 +149,13 @@ func (e *Engine) Peers() []peer.ID {
|
||||
// arguments.
|
||||
func (e *Engine) MessageReceived(p peer.ID, m bsmsg.BitSwapMessage) error {
|
||||
log := log.Prefix("bitswap.Engine.MessageReceived(%s)", p)
|
||||
log.Debugf("enter")
|
||||
log.Debugf("enter. %d entries %d blocks", len(m.Wantlist()), len(m.Blocks()))
|
||||
defer log.Debugf("exit")
|
||||
|
||||
if len(m.Wantlist()) == 0 && len(m.Blocks()) == 0 {
|
||||
log.Info("superfluous message")
|
||||
}
|
||||
|
||||
newWorkExists := false
|
||||
defer func() {
|
||||
if newWorkExists {
|
||||
@ -166,6 +170,7 @@ func (e *Engine) MessageReceived(p peer.ID, m bsmsg.BitSwapMessage) error {
|
||||
if m.Full() {
|
||||
l.wantList = wl.New()
|
||||
}
|
||||
|
||||
for _, entry := range m.Wantlist() {
|
||||
if entry.Cancel {
|
||||
log.Debug("cancel", entry.Key)
|
||||
|
Reference in New Issue
Block a user