Changes to the way piece prioritization affects the piece

This commit is contained in:
Matt Joiner 2015-06-01 18:23:35 +10:00
parent 21fb4933fc
commit 5b52769523
1 changed files with 8 additions and 3 deletions

View File

@ -344,9 +344,14 @@ func (cl *Client) prioritizePiece(t *torrent, piece int, priority piecePriority)
if t.havePiece(piece) {
return
}
cl.queueFirstHash(t, piece)
t.Pieces[piece].Priority = priority
cl.pieceChanged(t, piece)
if priority != PiecePriorityNone {
cl.queueFirstHash(t, piece)
}
p := t.Pieces[piece]
if p.Priority != priority {
p.Priority = priority
cl.pieceChanged(t, piece)
}
}
func (cl *Client) setEnvBlocklist() (err error) {