Skip to content

Commit

Permalink
Merge pull request #840 from SiaFoundation/pj/areq-panic
Browse files Browse the repository at this point in the history
Download panic
  • Loading branch information
ChrisSchinnerl authored Dec 19, 2023
2 parents 55780ec + bd6f8d5 commit 6a9ce44
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion worker/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,8 +930,14 @@ func (s *slabDownload) nextRequest(ctx context.Context, resps *sectorResponses,
return nil
}

// select the fastest host
fastest := s.mgr.fastest(hosts)
if fastest == (types.PublicKey{}) {
return nil // can happen if downloader got stopped
}

// make the fastest host the current host
s.curr = s.mgr.fastest(hosts)
s.curr = fastest
s.used[s.curr] = struct{}{}
}

Expand Down

0 comments on commit 6a9ce44

Please sign in to comment.