LocalVersion can move backwards as well as forwards

This commit is contained in:
Jakob Borg
2014-07-23 13:03:09 +02:00
parent 91cc84c4e6
commit 3b34895ae6
4 changed files with 11 additions and 5 deletions

View File

@@ -58,9 +58,7 @@ func (s *Set) Replace(node protocol.NodeID, fs []protocol.FileInfo) {
}
s.mutex.Lock()
defer s.mutex.Unlock()
if lv := ldbReplace(s.db, []byte(s.repo), node[:], fs); lv > s.localVersion[node] {
s.localVersion[node] = lv
}
s.localVersion[node] = ldbReplace(s.db, []byte(s.repo), node[:], fs)
}
func (s *Set) ReplaceWithDelete(node protocol.NodeID, fs []protocol.FileInfo) {