Skip to content

Commit 7a962c6

Browse files
committed
ignore the root returned in Commit function for simplicity
1 parent f3f5a78 commit 7a962c6

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

core/state/state_object.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ func (s *stateObject) commit() error {
454454
if s.dbErr != nil {
455455
return s.dbErr
456456
}
457-
root, err := s.trie.Commit(nil)
457+
_, err := s.trie.Commit(nil)
458458
if err == nil {
459-
s.data.Root = root
459+
//s.data.Root = root
460460
// Update original account data after commit
461461
s.origin = s.data.Copy()
462462
}

core/state/statedb.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er
10481048
return common.Hash{}, fmt.Errorf("commit aborted due to earlier error: %v", s.dbErr)
10491049
}
10501050
// Finalize any pending changes and merge everything into the tries
1051-
s.IntermediateRoot(deleteEmptyObjects)
1051+
root := s.IntermediateRoot(deleteEmptyObjects)
10521052

10531053
start := time.Now()
10541054
// Commit objects to the trie, measuring the elapsed time
@@ -1101,7 +1101,7 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er
11011101
// The onleaf func is called _serially_, so we can reuse the same account
11021102
// for unmarshalling every time.
11031103
var account types.StateAccount
1104-
root, err := s.trie.Commit(func(_ [][]byte, _ []byte, leaf []byte, parent common.Hash) error {
1104+
_, err := s.trie.Commit(func(_ [][]byte, _ []byte, leaf []byte, parent common.Hash) error {
11051105
if err := rlp.DecodeBytes(leaf, &account); err != nil {
11061106
return nil
11071107
}

0 commit comments

Comments
 (0)