Skip to content

Commit

Permalink
Merge pull request #3782 from ipfs/fix/bloom/put-no-cache
Browse files Browse the repository at this point in the history
fix: remove bloom filter check on Put call in blockstore
  • Loading branch information
whyrusleeping authored Mar 16, 2017
2 parents beebc85 + 9c194aa commit 183d005
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions blocks/blockstore/bloom_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ func (b *bloomcache) Get(k *cid.Cid) (blocks.Block, error) {
}

func (b *bloomcache) Put(bl blocks.Block) error {
if has, ok := b.hasCached(bl.Cid()); ok && has {
return nil
}

// See comment in PutMany
err := b.blockstore.Put(bl)
if err == nil {
b.bloom.AddTS(bl.Cid().Bytes())
Expand All @@ -155,7 +152,7 @@ func (b *bloomcache) Put(bl blocks.Block) error {

func (b *bloomcache) PutMany(bs []blocks.Block) error {
// bloom cache gives only conclusive resulty if key is not contained
// to reduce number of puts we need conclusive infomration if block is contained
// to reduce number of puts we need conclusive information if block is contained
// this means that PutMany can't be improved with bloom cache so we just
// just do a passthrough.
err := b.blockstore.PutMany(bs)
Expand Down

0 comments on commit 183d005

Please sign in to comment.