summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJakob Borg <jakob@kastelo.net>2020-05-08 14:18:00 +0200
committerGitHub <noreply@github.com>2020-05-08 14:18:00 +0200
commitc0c18a568c861fa25edef40a78a2e3e50f5dd734 (patch)
tree8dbe1edbe2124fbdfb5b20c17f11a199acfb8e03 /lib
parentb0b3abf76b7fb62c3cc24a82030761af757c841a (diff)
lib/db: Hold the bloom filter the right way (fixes #6614) (#6617)
Diffstat (limited to 'lib')
-rw-r--r--lib/db/lowlevel.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/db/lowlevel.go b/lib/db/lowlevel.go
index dd7091331..12a4c38d1 100644
--- a/lib/db/lowlevel.go
+++ b/lib/db/lowlevel.go
@@ -647,7 +647,7 @@ func (db *Lowlevel) gcIndirect(ctx context.Context) error {
}
key := blockListKey(it.Key())
- if blockFilter.Has(bloomHash(key)) {
+ if blockFilter.Has(bloomHash(key.BlocksHash())) {
matchedBlocks++
continue
}
@@ -672,8 +672,8 @@ func (db *Lowlevel) gcIndirect(ctx context.Context) error {
// Hash function for the bloomfilter: first eight bytes of the SHA-256.
// Big or little-endian makes no difference, as long as we're consistent.
-func bloomHash(key blockListKey) uint64 {
- return binary.BigEndian.Uint64(key.BlocksHash())
+func bloomHash(key []byte) uint64 {
+ return binary.BigEndian.Uint64(key)
}
// CheckRepair checks folder metadata and sequences for miscellaneous errors.