From b87bb74f31c31921545c268681c0e7761629f6a3 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sun, 29 Jun 2014 19:08:16 +1000 Subject: [PATCH] Fix a race where the last piece of a torrent is requested before it's been hashed --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index eb352290..bdc39177 100644 --- a/client.go +++ b/client.go @@ -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 }