2
0
mirror of synced 2025-02-24 14:48:27 +00:00

When queuing a piece for hashing after receiving a chunk, clear all the dirty chunks

This should fix a bug triggered by storage inconsistencies.
This commit is contained in:
Matt Joiner 2017-12-28 23:59:30 +11:00
parent 25cf92502d
commit 898db894e0

View 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. // the piece is still wanted, because if it is queued, it won't be wanted.
if t.pieceAllDirty(index) { if t.pieceAllDirty(index) {
t.queuePieceCheck(int(req.Index)) t.queuePieceCheck(int(req.Index))
t.pendAllChunkSpecs(index)
} }
if c.peerTouchedPieces == nil { if c.peerTouchedPieces == nil {