Use pendingPieces in needData

This commit is contained in:
Matt Joiner 2016-01-24 15:21:31 +11:00
parent 0ad4dda9fc
commit 9091c0518d
1 changed files with 3 additions and 0 deletions

View File

@ -1679,6 +1679,9 @@ func (t *torrent) needData() bool {
if !t.haveInfo() { if !t.haveInfo() {
return true return true
} }
if len(t.pendingPieces) != 0 {
return true
}
return !t.forReaderWantedRegionPieces(func(begin, end int) (again bool) { return !t.forReaderWantedRegionPieces(func(begin, end int) (again bool) {
for i := begin; i < end; i++ { for i := begin; i < end; i++ {
if !t.pieceComplete(i) { if !t.pieceComplete(i) {