mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-01 02:30:39 +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.counterLk.Lock()
|
||||||
bs.blocksRecvd++
|
bs.blocksRecvd++
|
||||||
has, err := bs.blockstore.Has(b.Key())
|
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 {
|
if err == nil && has {
|
||||||
bs.dupBlocksRecvd++
|
bs.dupBlocksRecvd++
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user