handle error
Jeromy committed
May 27, 2015 at 21:19 UTC
2ec4c9ac455dc4781e937d463b97aa6162d26c5c
1 file changed
+5
exchange/bitswap/bitswap.go
+5
@@ -295,6 +295,11 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
295
bs.counterLk.Lock()
296
bs.blocksRecvd++
297
has, err := bs.blockstore.Has(b.Key())
298
+ if err != nil {
299
+ bs.counterLk.Unlock()
300
+ log.Noticef("blockstore.Has error: %s", err)
301
+ return
302
+ }
303
if err == nil && has {
304
bs.dupBlocksRecvd++
305
}