Skip to content

Commit 4a0c9f0

Browse files
committed
core/state: fix bug about getting stable LogsHash result. ethereum#33082
1 parent 4bb9252 commit 4a0c9f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/state/statedb.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ func (s *StateDB) Logs() []*types.Log {
199199
for _, lgs := range s.logs {
200200
logs = append(logs, lgs...)
201201
}
202+
sort.Slice(logs, func(i, j int) bool {
203+
return logs[i].Index < logs[j].Index
204+
})
202205
return logs
203206
}
204207

0 commit comments

Comments
 (0)