diff --git a/chain/badtscache.go b/chain/badtscache.go index ca428ff30..1e2b67f39 100644 --- a/chain/badtscache.go +++ b/chain/badtscache.go @@ -1,14 +1,11 @@ package chain import ( - "sync" - lru "github.com/hashicorp/golang-lru" "github.com/ipfs/go-cid" ) type BadBlockCache struct { - lk sync.Mutex badBlocks *lru.ARCCache } @@ -24,13 +21,9 @@ func NewBadBlockCache() *BadBlockCache { } func (bts *BadBlockCache) Add(c cid.Cid) { - bts.lk.Lock() - defer bts.lk.Unlock() bts.badBlocks.Add(c, nil) } func (bts *BadBlockCache) Has(c cid.Cid) bool { - bts.lk.Lock() - defer bts.lk.Unlock() return bts.badBlocks.Contains(c) }