Skip to content

Commit e7ff54f

Browse files
committed
core/state: add codesize to cache
1 parent 6f2cbb7 commit e7ff54f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/state/reader.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ func (r *cachingCodeReader) CodeSize(addr common.Address, codeHash common.Hash)
147147
if err != nil {
148148
return 0, err
149149
}
150-
return len(code), nil
150+
n := len(code)
151+
r.codeSizeCache.Add(codeHash, n)
152+
return n, nil
151153
}
152154

153155
// flatReader wraps a database state reader and is safe for concurrent access.

0 commit comments

Comments
 (0)