@@ -82,8 +82,8 @@ type StateDB struct {
8282 db Database
8383 prefetcher * triePrefetcher
8484 trie Trie
85- hasher crypto.KeccakState
86- snap snapshot.Snapshot // Nil if snapshot is not available
85+ // hasher crypto.KeccakState
86+ snap snapshot.Snapshot // Nil if snapshot is not available
8787
8888 // originalRoot is the pre-state root, before any changes were made.
8989 // It will be updated when the Commit is called.
@@ -186,7 +186,7 @@ func New(root common.Hash, db Database) (*StateDB, error) {
186186 journal : newJournal (),
187187 accessList : newAccessList (),
188188 transientStorage : newTransientStorage (),
189- hasher : crypto .NewKeccakState (),
189+ // hasher: crypto.NewKeccakState(),
190190 }
191191 if snaps := sdb .db .Snapshot (); snaps != nil {
192192 sdb .snap = snaps .Snapshot (root )
@@ -645,7 +645,8 @@ func (s *StateDB) getStateObject(addr common.Address) *stateObject {
645645 var data * types.StateAccount
646646 if s .snap != nil {
647647 start := time .Now ()
648- acc , err := s .snap .Account (crypto .HashData (s .hasher , addr .Bytes ()))
648+ addrHash := crypto .Keccak256Hash (addr .Bytes ())
649+ acc , err := s .snap .Account (addrHash )
649650 s .SnapshotAccountReads += time .Since (start )
650651 if err == nil {
651652 if acc == nil {
@@ -781,9 +782,9 @@ func (db *StateDB) ForEachStorage(addr common.Address, cb func(key, value common
781782func (s * StateDB ) Copy () * StateDB {
782783 // Copy all the basic fields, initialize the memory ones
783784 state := & StateDB {
784- db : s .db ,
785- trie : s .db .CopyTrie (s .trie ),
786- hasher : crypto .NewKeccakState (),
785+ db : s .db ,
786+ trie : s .db .CopyTrie (s .trie ),
787+ // hasher: crypto.NewKeccakState(),
787788 originalRoot : s .originalRoot ,
788789 accounts : copySet (s .accounts ),
789790 storages : copy2DSet (s .storages ),
0 commit comments