Don't get stuck in idle while syncing from a disconnecting node

This commit is contained in:
Jakob Borg
2014-09-28 07:56:05 +02:00
parent 6f750582dd
commit b8ed135183
2 changed files with 27 additions and 1 deletions

View File

@@ -65,6 +65,10 @@ func (s *Set) Replace(node protocol.NodeID, fs []protocol.FileInfo) {
s.mutex.Lock()
defer s.mutex.Unlock()
s.localVersion[node] = ldbReplace(s.db, []byte(s.repo), node[:], fs)
if len(fs) == 0 {
// Reset the local version if all files were removed.
s.localVersion[node] = 0
}
}
func (s *Set) ReplaceWithDelete(node protocol.NodeID, fs []protocol.FileInfo) {