Commit e34c9b1b authored by Christopher Schinnerl's avatar Christopher Schinnerl

don't return early but clarify comment

parent 9d71e2ae
......@@ -104,10 +104,10 @@ func (hd *Downloader) Sector(root crypto.Hash) (_ modules.RenterContract, _ []by
extendDeadline(hd.conn, connTimeout)
signedTxn, err := negotiateRevision(hd.conn, rev, contract.SecretKey, hd.height)
if err == modules.ErrStopResponse {
// if host gracefully closed, close our connection as well. We return
// ErrStopResponse to avoid penalizing the host.
_ = hd.conn.Close()
return modules.RenterContract{}, nil, err
// If the host wants to stop communicating after this iteration, closer
// our connection; this will cause the next download to fail. However,
// we must delay closing until we've finished downloading the sector.
defer hd.conn.Close()
} else if err != nil {
return modules.RenterContract{}, nil, err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment