lib/model: Discard download progress upon receiving an index update (fixes #2993)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3023
This commit is contained in:
Audrius Butkevicius
2016-05-01 06:49:29 +00:00
committed by Jakob Borg
parent 49387f9494
commit 29fa05ae05
2 changed files with 28 additions and 0 deletions

View File

@@ -97,6 +97,9 @@ type deviceDownloadState struct {
// Update updates internal state of what has been downloaded into the temporary
// files by the remote device for this specific folder.
func (t *deviceDownloadState) Update(folder string, updates []protocol.FileDownloadProgressUpdate) {
if t == nil {
return
}
t.mut.RLock()
f, ok := t.folders[folder]
t.mut.RUnlock()