mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 09:59:13 +08:00
handle error
This commit is contained in:
@ -295,6 +295,11 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
|
||||
bs.counterLk.Lock()
|
||||
bs.blocksRecvd++
|
||||
has, err := bs.blockstore.Has(b.Key())
|
||||
if err != nil {
|
||||
bs.counterLk.Unlock()
|
||||
log.Noticef("blockstore.Has error: %s", err)
|
||||
return
|
||||
}
|
||||
if err == nil && has {
|
||||
bs.dupBlocksRecvd++
|
||||
}
|
||||
|
Reference in New Issue
Block a user