Skip to content

Commit

Permalink
core/state: avoid redundant addition to code size cache (ethereum#16427)
Browse files Browse the repository at this point in the history
  • Loading branch information
LLLeon authored and firmianavan committed Aug 28, 2018
1 parent 4cb2180 commit 92dd24a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions core/state/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 92dd24a

Please sign in to comment.