cmd/stindex, lib/db: Use same condition to check for needed files (#6954)

This commit is contained in:
Simon Frei
2020-09-04 13:59:04 +02:00
committed by GitHub
parent 71bfad0bc6
commit 0e3e0a7c9e
2 changed files with 17 additions and 17 deletions
+5 -5
View File
@@ -333,10 +333,10 @@ func idxck(ldb backend.Backend) (success bool) {
}
func needsLocally(vl db.VersionList) bool {
fv, ok := vl.Get(protocol.LocalDeviceID[:])
if !ok {
return true // proviosinally, it looks like we need the file
gfv, gok := vl.GetGlobal()
if !gok { // That's weird, but we hardly need something non-existant
return false
}
gfv, _ := vl.GetGlobal() // Can't not have a global if we got something above
return !fv.Version.GreaterEqual(gfv.Version)
fv, ok := vl.Get(protocol.LocalDeviceID[:])
return db.Need(gfv, ok, fv.Version)
}