Comment on connection.updatePiecePriority

There's also Torrent.updatePiecePriority, and it's always confusing what the difference is.
This commit is contained in:
Matt Joiner 2016-10-31 16:22:07 +11:00
parent 5e83287890
commit a49e133d8a
1 changed files with 4 additions and 0 deletions

View File

@ -520,6 +520,10 @@ func (cn *connection) stopRequestingPiece(piece int) {
cn.pieceRequestOrder.Remove(piece)
}
// This is distinct from Torrent piece priority, which is the user's
// preference. Connection piece priority is specific to a connection,
// pseudorandomly avoids connections always requesting the same pieces and
// thus wasting effort.
func (cn *connection) updatePiecePriority(piece int) {
tpp := cn.t.piecePriority(piece)
if !cn.PeerHasPiece(piece) {