move set back to account-trie-update block scoping for easier readability

This commit is contained in:
Jared Wasinger 2024-05-29 05:26:17 -07:00
parent 659a98c56a
commit 0d78087e88

View file

@ -1159,7 +1159,6 @@ func (s *StateDB) commit(deleteEmptyObjects bool) (*stateUpdate, error) {
start = time.Now() start = time.Now()
root common.Hash root common.Hash
workers errgroup.Group workers errgroup.Group
set *trienode.NodeSet
) )
// Schedule the account trie first since that will be the biggest, so give // Schedule the account trie first since that will be the biggest, so give
// it the most time to crunch. // it the most time to crunch.
@ -1172,7 +1171,8 @@ func (s *StateDB) commit(deleteEmptyObjects bool) (*stateUpdate, error) {
// code didn't anticipate for. // code didn't anticipate for.
workers.Go(func() error { workers.Go(func() error {
// Write the account trie changes, measuring the amount of wasted time // Write the account trie changes, measuring the amount of wasted time
root, set = s.trie.Commit(true) newroot, set := s.trie.Commit(true)
root = newroot
if err := merge(set); err != nil { if err := merge(set); err != nil {
return err return err