@@ -1004,7 +1004,6 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
10041004 var (
10051005 usedAddrs []common.Address
10061006 deletedAddrs []common.Address
1007- updatedObjs []* stateObject
10081007 )
10091008 for addr , op := range s .mutations {
10101009 if op .applied {
@@ -1015,7 +1014,7 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
10151014 if op .isDelete () {
10161015 deletedAddrs = append (deletedAddrs , addr )
10171016 } else {
1018- updatedObjs = append ( updatedObjs , s .stateObjects [addr ])
1017+ s . updateStateObject ( s .stateObjects [addr ])
10191018 s .AccountUpdated += 1
10201019 }
10211020 usedAddrs = append (usedAddrs , addr ) // Copy needed for closure
@@ -1032,20 +1031,6 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
10321031 // Track the amount of time wasted on hashing the account trie
10331032 defer func (start time.Time ) { s .AccountHashes += time .Since (start ) }(time .Now ())
10341033 hash := s .trie .Hash ()
1035- /*
1036- it, err := s.trie.NodeIterator([]byte{})
1037- if err != nil {
1038- panic(err)
1039- }
1040- fmt.Println("state trie")
1041- for it.Next(true) {
1042- if it.Leaf() {
1043- fmt.Printf("%x: %x\n", it.Path(), it.LeafBlob())
1044- } else {
1045- fmt.Printf("%x: %x\n", it.Path(), it.Hash())
1046- }
1047- }
1048- */
10491034 // If witness building is enabled, gather the account trie witness
10501035 if s .witness != nil {
10511036 witness := s .trie .Witness ()
0 commit comments