lib/db: Correct need accounting on reset (fixes #6784) (#6785)

This commit is contained in:
Simon Frei
2020-06-23 07:29:27 +02:00
committed by GitHub
parent 5fb3992275
commit 4881a6336f
2 changed files with 33 additions and 3 deletions
+7 -3
View File
@@ -314,9 +314,13 @@ func (m *metadataTracker) resetAll(dev protocol.DeviceID) {
m.dirty = true
for i, c := range m.counts.Counts {
if bytes.Equal(c.DeviceID, dev[:]) {
m.counts.Counts[i] = Counts{
DeviceID: c.DeviceID,
LocalFlags: c.LocalFlags,
if c.LocalFlags != needFlag {
m.counts.Counts[i] = Counts{
DeviceID: c.DeviceID,
LocalFlags: c.LocalFlags,
}
} else {
m.counts.Counts[i] = m.allNeededCounts(dev)
}
}
}