From: Matt Joiner Date: Mon, 31 Oct 2016 05:22:07 +0000 (+1100) Subject: Comment on connection.updatePiecePriority X-Git-Tag: v1.0.0~545 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=a49e133d8a4a22900b48ecf6ef935b986ead2d39;p=btrtrc.git Comment on connection.updatePiecePriority There's also Torrent.updatePiecePriority, and it's always confusing what the difference is. --- diff --git a/connection.go b/connection.go index afd9d3a4..7e88f837 100644 --- a/connection.go +++ b/connection.go @@ -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) {