diff --git a/core/state/statedb.go b/core/state/statedb.go index 81e1cedbb9..f6e6fac1bb 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1237,7 +1237,7 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er if metrics.EnabledExpensive { defer func(start time.Time) { s.TrieAllCommits += time.Since(start) }(time.Now()) } - if s.stateRoot = s.StateIntermediateRoot(); s.expectedRoot != s.stateRoot { + if s.stateRoot = s.IntermediateRoot(deleteEmptyObjects); s.expectedRoot != s.stateRoot { log.Error("Invalid merkle root", "remote", s.expectedRoot, "local", s.stateRoot) return fmt.Errorf("invalid merkle root (remote: %x local: %x)", s.expectedRoot, s.stateRoot) }