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

Commit

Permalink
use bloom filter in GetSize
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann committed Jun 18, 2021
1 parent a34559d commit 95a1a08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bloom_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ func (b *bloomcache) Has(k cid.Cid) (bool, error) {
}

func (b *bloomcache) GetSize(k cid.Cid) (int, error) {
if has, ok := b.hasCached(k); ok && !has {
return -1, ErrNotFound
}

return b.blockstore.GetSize(k)
}

Expand Down

0 comments on commit 95a1a08

Please sign in to comment.