mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-22 20:56:42 +00:00
core/state: add codesize to cache
This commit is contained in:
parent
6f2cbb7a27
commit
e7ff54fcbc
1 changed files with 3 additions and 1 deletions
|
|
@ -147,7 +147,9 @@ func (r *cachingCodeReader) CodeSize(addr common.Address, codeHash common.Hash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
return len(code), nil
|
n := len(code)
|
||||||
|
r.codeSizeCache.Add(codeHash, n)
|
||||||
|
return n, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// flatReader wraps a database state reader and is safe for concurrent access.
|
// flatReader wraps a database state reader and is safe for concurrent access.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue