Record connection dirtied piece before queuing for hash
Not a bug, but probably more robust.
This commit is contained in:
parent
dc643d2ed3
commit
4fae1f81df
|
@ -1400,13 +1400,13 @@ func (c *connection) receiveChunk(msg *pp.Message) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
c.onDirtiedPiece(pieceIndex(req.Index))
|
||||
|
||||
if t.pieceAllDirty(pieceIndex(req.Index)) {
|
||||
t.queuePieceCheck(pieceIndex(req.Index))
|
||||
t.pendAllChunkSpecs(pieceIndex(req.Index))
|
||||
}
|
||||
|
||||
c.onDirtiedPiece(pieceIndex(req.Index))
|
||||
|
||||
cl.event.Broadcast()
|
||||
// We do this because we've written a chunk, and may change PieceState.Partial.
|
||||
t.publishPieceChange(pieceIndex(req.Index))
|
||||
|
|
Loading…
Reference in New Issue