diff --git a/core/state/statedb.go b/core/state/statedb.go index f98df2da19..e61c592f6a 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1233,11 +1233,11 @@ func (s *StateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, er nodes = trienode.NewMergedNodeSet() incomplete map[common.Address]struct{} ) - //if s.stateRoot = s.StateIntermediateRoot(); s.expectedRoot != s.stateRoot { - // 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) - //} + if block == 0 { + if s.stateRoot = s.StateIntermediateRoot(); s.expectedRoot != s.stateRoot { + s.expectedRoot = s.stateRoot + } + } commmitTrie := func() error { if metrics.EnabledExpensive { defer func(start time.Time) { s.TrieAllCommits += time.Since(start) }(time.Now())