Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 934aaca

Browse files
committedMay 22, 2015
fix minor data race in bitswap
1 parent 988b158 commit 934aaca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎exchange/bitswap/bitswap.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
287287
if has, err := bs.blockstore.Has(block.Key()); err == nil && has {
288288
bs.dupBlocksRecvd++
289289
}
290-
bs.counterLk.Unlock()
291290
log.Infof("got block %s from %s (%d,%d)", block, p, bs.blocksRecvd, bs.dupBlocksRecvd)
291+
bs.counterLk.Unlock()
292292

293293
hasBlockCtx, cancel := context.WithTimeout(ctx, hasBlockTimeout)
294294
if err := bs.HasBlock(hasBlockCtx, block); err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.