]> Sergey Matveev's repositories - btrtrc.git/commitdiff
When queuing a piece for hashing after receiving a chunk, clear all the dirty chunks
authorMatt Joiner <anacrolix@gmail.com>
Thu, 28 Dec 2017 12:59:30 +0000 (23:59 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 28 Dec 2017 12:59:30 +0000 (23:59 +1100)
This should fix a bug triggered by storage inconsistencies.

connection.go

index 7a9b54820fd580c89259e710c063f1f28300c667..b87562157eca88fee3ffc406919c68f53f26f74e 100644 (file)
@@ -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 {