lib/db: Handle missing block lists as missing file (ref #6321) (#6322)

Also explicitly handle non-nil but empty block lists (if they should
ever pop up as an effect of unmarshalling changes or whatnot).
This commit is contained in:
Jakob Borg
2020-02-11 15:37:22 +01:00
committed by GitHub
parent 29736b1e33
commit 04e648fee6
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -550,7 +550,9 @@ func (db *Lowlevel) gcBlocks() error {
if err := bl.Unmarshal(it.Value()); err != nil {
return err
}
filter.Add(bl.BlocksHash)
if len(bl.BlocksHash) > 0 {
filter.Add(bl.BlocksHash)
}
}
it.Release()
if err := it.Error(); err != nil {