return p.t.pieceRequestIndexBegin(p.index + 1)
}
-// TODO: Make this peer-only?
func (p *Piece) availability() int {
return len(p.t.connsWithAllPieces) + p.relativeAvailability
}
}
func (t *Torrent) incPieceAvailability(i pieceIndex) {
- // If we don't the info, this should be reconciled when we do.
+ // If we don't have the info, this should be reconciled when we do.
if t.haveInfo() {
p := t.piece(i)
p.relativeAvailability++
}
func (t *Torrent) numActivePeers() int {
+ // TODO: Webseeds are "active" if they can serve any data. That means we need to track what
+ // pieces they're able to provide.
return len(t.conns) + len(t.webSeeds)
}