lru¶
| Source (upstream pre-purge) | Current | |
|---|---|---|
| File | consensus/ethash/ethash.go |
ethash.go |
| Symbol | lru |
lru |
| Ref | dde2da0ef~1 |
etc/v1.17.3-full-node |
3-way merge — purge → getc ← upstream¶
pre-purgecore-geth
↗// lru tracks caches or datasets by their last use time, keeping at most N of them.
type lru[T cacheOrDataset] struct {
what string
↗ new func(epoch uint64, epochLength uint64) T
↗ mu sync.Mutex
// Items are kept in a LRU cache, but there is a special case:
// We always keep an item for (highest seen epoch) + 1 as the 'future item'.
cache lrupkg.BasicLRU[uint64, T]
future uint64
futureItem T
}