torrent.go | 5 ++++- diff --git a/torrent.go b/torrent.go index d53efb0acb96ec75fe4ebc17b84e9b53cb755cd2..d0f81fd7f1bc3a2628ca5abd3616b0d486b74e1e 100644 --- a/torrent.go +++ b/torrent.go @@ -982,7 +982,10 @@ } func (t *Torrent) unpendPieces(unpend *bitmap.Bitmap) { t.pendingPieces.Sub(unpend) - t.updatePiecePriorities() + unpend.IterTyped(func(piece int) (again bool) { + t.updatePiecePriority(piece) + return true + }) } func (t *Torrent) pendPieceRange(begin, end int) {