From 898db894e076940613c3243926fda63b708267ef Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 28 Dec 2017 23:59:30 +1100 Subject: [PATCH] When queuing a piece for hashing after receiving a chunk, clear all the dirty chunks This should fix a bug triggered by storage inconsistencies. --- connection.go | 1 + 1 file changed, 1 insertion(+) diff --git a/connection.go b/connection.go index 7a9b5482..b8756215 100644 --- a/connection.go +++ b/connection.go @@ -1080,6 +1080,7 @@ func (c *connection) receiveChunk(msg *pp.Message) { // the piece is still wanted, because if it is queued, it won't be wanted. if t.pieceAllDirty(index) { t.queuePieceCheck(int(req.Index)) + t.pendAllChunkSpecs(index) } if c.peerTouchedPieces == nil {