connection.go | 6 +++--- piece.go | 3 +-- torrent.go | 1 + diff --git a/connection.go b/connection.go index 794f59860ba79aa544d10fe29845a57dc46cc545..c8e2892061fc09620d993d68ce75161e5a90d93c 100644 --- a/connection.go +++ b/connection.go @@ -614,9 +614,9 @@ return 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. +// preference. Connection piece priority is specific to a connection and is +// used to pseudorandomly avoid connections always requesting the same pieces +// and thus wasting effort. func (cn *connection) updatePiecePriority(piece int) bool { tpp := cn.t.piecePriority(piece) if !cn.PeerHasPiece(piece) { diff --git a/piece.go b/piece.go index c5d7f134677932533a82a9d16369137d72e65f11..fcec86239a5717453be4a37f1245f6d53444ab83 100644 --- a/piece.go +++ b/piece.go @@ -11,8 +11,7 @@ pp "github.com/anacrolix/torrent/peer_protocol" "github.com/anacrolix/torrent/storage" ) -// Piece priority describes the importance of obtaining a particular piece. - +// Describes the importance of obtaining a particular piece. type piecePriority byte func (pp *piecePriority) Raise(maybe piecePriority) { diff --git a/torrent.go b/torrent.go index 6440a3f823636e4925d6465ad82c6be5a56985f7..4d8ace428cd7e7c8698e1f92cdd4a6b9ec23b166 100644 --- a/torrent.go +++ b/torrent.go @@ -1557,6 +1557,7 @@ conn.Have(piece) } } +// Called when a piece is found to be not complete. func (t *Torrent) onIncompletePiece(piece int) { if t.pieceAllDirty(piece) { t.pendAllChunkSpecs(piece)