connection.go | 2 ++ diff --git a/connection.go b/connection.go index aea9d49d544123c7844068a9bbe08d9135269564..29d63a5664923f0e371901c144281fec20d15fb4 100644 --- a/connection.go +++ b/connection.go @@ -485,6 +485,7 @@ // changes in .sentHaves. cn.sentHaves = append([]bool(nil), haves...) } +// Determines interest and requests to send to a connected peer. func nextRequestState( networkingEnabled bool, currentRequests map[request]struct{}, @@ -615,6 +616,7 @@ } func undirtiedChunks(piece int, t *Torrent, f func(chunkSpec) bool) bool { chunkIndices := t.pieces[piece].undirtiedChunkIndices().ToSortedSlice() + // TODO: Use "math/rand".Shuffle >= Go 1.10 return iter.ForPerm(len(chunkIndices), func(i int) bool { return f(t.chunkIndexSpec(chunkIndices[i], piece)) })