Remove premature update to piece priority after piece is completed

This should have prevented Torrent.piecePriorityChanged from being called, meaning requests for the completed piece were not canceled, and the piece remained in connection's piece request queue, which meant wasted effort downloading chunks for an already acquired piece.

Thanks to @elgatito for discovering the issue.
This commit is contained in:
Matt Joiner 2018-01-28 15:52:14 +11:00
parent e08d11a4b9
commit de928be582
1 changed files with 0 additions and 1 deletions

View File

@ -1515,7 +1515,6 @@ func (t *Torrent) cancelRequestsForPiece(piece int) {
}
func (t *Torrent) onPieceCompleted(piece int) {
t.pendingPieces.Remove(piece)
t.pendAllChunkSpecs(piece)
t.cancelRequestsForPiece(piece)
for conn := range t.conns {