@@ -234,19 +234,12 @@ func (u *latestEventsUpdater) latestState() error {
234
234
}
235
235
}
236
236
237
- // Take the old set of extremities and the new set of extremities and
238
- // mash them together into a list. This may or may not include the new event
239
- // from the input path, depending on whether it became a forward extremity
240
- // or not. We'll then run state resolution across all of them to determine
241
- // the new current state of the room. Including the old extremities here
242
- // ensures that new forward extremities with bad state snapshots (from
243
- // possible malicious actors) can't completely corrupt the room state
244
- // away from what it was before.
245
- combinedExtremities := types .StateAtEventAndReferences (append (u .oldLatest , u .latest ... ))
246
- combinedExtremities = combinedExtremities [:util .SortAndUnique (combinedExtremities )]
247
- latestStateAtEvents := make ([]types.StateAtEvent , len (combinedExtremities ))
248
- for i := range combinedExtremities {
249
- latestStateAtEvents [i ] = combinedExtremities [i ].StateAtEvent
237
+ // Get a list of the current latest events. This may or may not
238
+ // include the new event from the input path, depending on whether
239
+ // it is a forward extremity or not.
240
+ latestStateAtEvents := make ([]types.StateAtEvent , len (u .latest ))
241
+ for i := range u .latest {
242
+ latestStateAtEvents [i ] = u .latest [i ].StateAtEvent
250
243
}
251
244
252
245
// Takes the NIDs of the latest events and creates a state snapshot
0 commit comments