p.t.updatePieceCompletion(p.index)
}
+// TODO: Probably don't include Completion.Err?
func (p *Piece) completion() (ret storage.Completion) {
ret.Ok = p.storageCompletionOk
if ret.Ok {
// I don't think we need this for correctness purposes, but it must be faster to look up the Torrent
// input because it's locked to a given Torrent. It would be easy enough to drop in the
-// multi-torrent version in this place and compare.
+// multi-torrent version in this place and compare. TODO: With unique.Handle on infohash, this would
+// not be necessary anymore. I don't think it's provided any performance benefit for some time now.
type requestStrategyInputSingleTorrent struct {
requestStrategyInputCommon
t *Torrent
if t.hasStorageCap() {
return pro.pieces.Update(key, t.requestStrategyPieceOrderState(pieceIndex))
}
+ // TODO: This might eject a piece that could count toward being unverified?
pending := !t.ignorePieceForRequests(pieceIndex)
if pending {
newState := t.requestStrategyPieceOrderState(pieceIndex)