Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions common/lru/blob_lru.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type SizeConstrainedLRU struct {
size uint64
maxSize uint64
lru *simplelru.LRU
lock sync.RWMutex
lock sync.Mutex
}

// NewSizeConstrainedLRU creates a new SizeConstrainedLRU.
Expand Down Expand Up @@ -78,8 +78,8 @@ func (c *SizeConstrainedLRU) Add(key common.Hash, value []byte) (evicted bool) {

// Get looks up a key's value from the cache.
func (c *SizeConstrainedLRU) Get(key common.Hash) []byte {
c.lock.RLock()
defer c.lock.RUnlock()
c.lock.Lock()
defer c.lock.Unlock()

if v, ok := c.lru.Get(key); ok {
return v.([]byte)
Expand Down