github.com/anacrolix/torrent@v1.61.0/internal/request-strategy/piece.go (about) 1 package requestStrategy 2 3 type Piece interface { 4 // Whether requests should be made for this piece. This would be false for cases like the piece 5 // is currently being hashed, or already complete. 6 Request() bool 7 // Whether the piece should be counted towards the unverified bytes limit. The intention is to 8 // prevent pieces being starved from the opportunity to move to the completed state. Pieces that 9 // are in an overhead state like being hashed, queued, or having metadata modified are here. If 10 // we didn't count them we could race ahead downloading and leave lots of pieces stuck in an 11 // intermediate state. 12 CountUnverified() bool 13 }