diff --git a/lib/blockcache/blockcache.go b/lib/blockcache/blockcache.go index 62920e50c..0b2c5e748 100644 --- a/lib/blockcache/blockcache.go +++ b/lib/blockcache/blockcache.go @@ -199,7 +199,10 @@ end: // Len returns the number of blocks in the cache c. func (c *Cache) Len() int { c.mu.RLock() - n := len(c.m) + n := 0 + for _, m := range c.m { + n += len(m) + } c.mu.RUnlock() return n }