]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Comment on connection.updatePiecePriority
authorMatt Joiner <anacrolix@gmail.com>
Mon, 31 Oct 2016 05:22:07 +0000 (16:22 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 31 Oct 2016 05:22:07 +0000 (16:22 +1100)
There's also Torrent.updatePiecePriority, and it's always confusing what the difference is.

connection.go

index afd9d3a456e051417dc4ac3491e5005baffb2382..7e88f837d53ebfa4267a14f2f104323a9992ae90 100644 (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) {