Skip to content

Commit

Permalink
fix condition.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Nov 15, 2020
1 parent a2db17c commit 7b42f33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/blockstore/cache_freecache.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func (c *FreecacheCachingBlockstore) cachedValFn(k []byte, valFn func([]byte) er
f = (*freecache.Cache).PeekFn
}
// check the exists cache.
if err := f(c.existsCache, k, existsFn); err != errNotExists {
if err := f(c.existsCache, k, existsFn); err == errNotExists {
return false, nil, true
}
if err := f(c.blockCache, k, valFn); err != ErrNotFound {
Expand All @@ -327,7 +327,7 @@ func (c *FreecacheCachingBlockstore) cachedValFn(k []byte, valFn func([]byte) er
// cache.
func (c *FreecacheCachingBlockstore) cachedVal(k []byte) (val []byte, have bool, conclusive bool) {
// check the exists cache.
if err := c.existsCache.GetFn(k, existsFn); err != errNotExists {
if err := c.existsCache.GetFn(k, existsFn); err == errNotExists {
return nil, false, true
}
if val, err := c.blockCache.Get(k); err != ErrNotFound {
Expand Down

0 comments on commit 7b42f33

Please sign in to comment.