]> Sergey Matveev's repositories - btrtrc.git/blobdiff - request-strategy/piece.go
Don't starve unverified bytes limit on unrequestable pieces
[btrtrc.git] / request-strategy / piece.go
index 8483da45d7026583fde5475b164d7dbd2ccdc507..02c9ff658945a506ca7d1b35894a95041872362f 100644 (file)
@@ -1,6 +1,10 @@
 package requestStrategy
 
 type Piece interface {
+       // Whether requests should be made for this piece. This would be false for cases like the piece
+       // is currently being hashed, or already complete.
        Request() bool
-       NumPendingChunks() int
+       // Whether the piece should be counted towards the unverified bytes limit. The intention is to
+       // prevent pieces being starved from the opportunity to move to the completed state.
+       CountUnverified() bool
 }