From 354a01a659618418746ccad2908917185679cfad Mon Sep 17 00:00:00 2001 From: LLLeon Date: Mon, 2 Apr 2018 14:27:43 +0800 Subject: [PATCH 1/2] core/state: remove redundant code --- core/state/database.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/state/database.go b/core/state/database.go index 36926ec69d28c..592058f06d7b1 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -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 } From cd227f42e9717566e7f56ad856ccc5b1c61a383c Mon Sep 17 00:00:00 2001 From: LLLeon Date: Mon, 2 Apr 2018 15:59:48 +0800 Subject: [PATCH 2/2] core/state: fix typo --- core/state/database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/state/database.go b/core/state/database.go index 592058f06d7b1..c1b630991ce07 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 (