From a49e133d8a4a22900b48ecf6ef935b986ead2d39 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 31 Oct 2016 16:22:07 +1100 Subject: [PATCH] Comment on connection.updatePiecePriority There's also Torrent.updatePiecePriority, and it's always confusing what the difference is. --- connection.go | 4 ++++ 1 file changed, 4 insertions(+) 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) {