Skip to content

Commit 5909482

Browse files
LLLeonfjl
authored andcommitted
core/state: avoid redundant addition to code size cache (#16427)
1 parent d1af4e1 commit 5909482

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎core/state/database.go‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
lru "github.com/hashicorp/golang-lru"
2727
)
2828

29-
// Trie cache generation limit after which to evic trie nodes from memory.
29+
// Trie cache generation limit after which to evict trie nodes from memory.
3030
var MaxTrieCacheGen = uint16(120)
3131

3232
const (
@@ -151,9 +151,6 @@ func (db *cachingDB) ContractCodeSize(addrHash, codeHash common.Hash) (int, erro
151151
return cached.(int), nil
152152
}
153153
code, err := db.ContractCode(addrHash, codeHash)
154-
if err == nil {
155-
db.codeSizeCache.Add(codeHash, len(code))
156-
}
157154
return len(code), err
158155
}
159156

0 commit comments

Comments
 (0)