Skip to content
This repository was archived by the owner on Jun 19, 2023. It is now read-only.

Commit 95a1a08

Browse files
committed
use bloom filter in GetSize
1 parent a34559d commit 95a1a08

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bloom_cache.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ func (b *bloomcache) Has(k cid.Cid) (bool, error) {
148148
}
149149

150150
func (b *bloomcache) GetSize(k cid.Cid) (int, error) {
151+
if has, ok := b.hasCached(k); ok && !has {
152+
return -1, ErrNotFound
153+
}
154+
151155
return b.blockstore.GetSize(k)
152156
}
153157

0 commit comments

Comments
 (0)