lib/model: Don't deadlock when returning temp index block counts

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3194
This commit is contained in:
Jakob Borg 2016-05-26 09:16:08 +00:00
parent c513171014
commit 9bb5988b4e
1 changed files with 2 additions and 1 deletions

View File

@ -140,12 +140,13 @@ func (t *deviceDownloadState) GetBlockCounts(folder string) map[string]int {
}
t.mut.RLock()
defer t.mut.RUnlock()
for name, state := range t.folders {
if name == folder {
return state.GetBlockCounts()
}
}
t.mut.RUnlock()
return nil
}