diff --git a/core/blockchain.go b/core/blockchain.go index 48e11d25ae..2bc42d1972 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1935,7 +1935,7 @@ func (bc *BlockChain) processBlock(parentRoot common.Hash, block *types.Block, s // // Note: the main processor and prefetcher share the same reader with a local // cache for mitigating the overhead of state access. - prefetch, process, err := bc.statedb.ReaderWithCacheStats(parentRoot) + prefetch, process, err := bc.statedb.ReadersWithCacheStats(parentRoot) if err != nil { return nil, err } diff --git a/core/state/database.go b/core/state/database.go index 8e7b1175c1..5fb198a629 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -209,9 +209,10 @@ func (db *CachingDB) Reader(stateRoot common.Hash) (Reader, error) { return newReader(newCachingCodeReader(db.disk, db.codeCache, db.codeSizeCache), combined), nil } -// ReaderWithCacheStats creates a pair of state readers with internal local cache +// ReadersWithCacheStats creates a pair of state readers sharing the same internal cache and +// same backing Reader, but exposing separate statistics. // and statistics. -func (db *CachingDB) ReaderWithCacheStats(stateRoot common.Hash) (ReaderWithStats, ReaderWithStats, error) { +func (db *CachingDB) ReadersWithCacheStats(stateRoot common.Hash) (ReaderWithStats, ReaderWithStats, error) { reader, err := db.Reader(stateRoot) if err != nil { return nil, nil, err