aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJia Chenhui <jiachenhui1989@gmail.com>2018-04-03 23:13:19 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-04-03 23:13:19 +0800
commit5909482fb55095b58ff3f9d8207a4daa69defe26 (patch)
treedbbfdbc6888ec64763a8bf4ea953a854ce774979 /core
parentd1af4e1a9eae903514dc6e0afd665218a90a19bf (diff)
downloadgo-tangerine-5909482fb55095b58ff3f9d8207a4daa69defe26.tar
go-tangerine-5909482fb55095b58ff3f9d8207a4daa69defe26.tar.gz
go-tangerine-5909482fb55095b58ff3f9d8207a4daa69defe26.tar.bz2
go-tangerine-5909482fb55095b58ff3f9d8207a4daa69defe26.tar.lz
go-tangerine-5909482fb55095b58ff3f9d8207a4daa69defe26.tar.xz
go-tangerine-5909482fb55095b58ff3f9d8207a4daa69defe26.tar.zst
go-tangerine-5909482fb55095b58ff3f9d8207a4daa69defe26.zip
core/state: avoid redundant addition to code size cache (#16427)
Diffstat (limited to 'core')
-rw-r--r--core/state/database.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/core/state/database.go b/core/state/database.go
index 36926ec69..c1b630991 100644
--- a/core/state/database.go
+++ b/core/state/database.go
@@ -26,7 +26,7 @@ import (
lru "github.com/hashicorp/golang-lru"
)
-// Trie cache generation limit after which to evic trie nodes from memory.
+// Trie cache generation limit after which to evict trie nodes from memory.
var MaxTrieCacheGen = uint16(120)
const (
@@ -151,9 +151,6 @@ func (db *cachingDB) ContractCodeSize(addrHash, codeHash common.Hash) (int, erro
return cached.(int), nil
}
code, err := db.ContractCode(addrHash, codeHash)
- if err == nil {
- db.codeSizeCache.Add(codeHash, len(code))
- }
return len(code), err
}