Fix a race where the last piece of a torrent is requested before it's been hashed

This commit is contained in:
Matt Joiner 2014-06-29 19:08:16 +10:00
parent 3b29043861
commit b87bb74f31
1 changed files with 1 additions and 1 deletions

View File

@ -1019,7 +1019,7 @@ func (s *DefaultDownloadStrategy) FillRequests(t *torrent, c *connection) {
th := s.heat[t]
addRequest := func(req request) (again bool) {
piece := t.Pieces[req.Index]
if piece.Hashing {
if piece.Hashing || piece.QueuedForHash {
// We can't be sure we want this.
return true
}