Skip to content

Commit

Permalink
fix: miner root hash check
Browse files Browse the repository at this point in the history
  • Loading branch information
joeylichang committed Apr 15, 2024
1 parent 3f89824 commit b29d032
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit b29d032

Please sign in to comment.