]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Use pendingPieces in needData
authorMatt Joiner <anacrolix@gmail.com>
Sun, 24 Jan 2016 04:21:31 +0000 (15:21 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 24 Jan 2016 04:21:31 +0000 (15:21 +1100)
client.go

index d1dcd4a8f7c866442356dbd5774576c82ee00416..007186e91fd1613c4cae86ca84b3db98cea7f4fc 100644 (file)
--- a/client.go
+++ b/client.go
@@ -1679,6 +1679,9 @@ func (t *torrent) needData() bool {
        if !t.haveInfo() {
                return true
        }
+       if len(t.pendingPieces) != 0 {
+               return true
+       }
        return !t.forReaderWantedRegionPieces(func(begin, end int) (again bool) {
                for i := begin; i < end; i++ {
                        if !t.pieceComplete(i) {