mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 00:03:09 -06:00
Re-add existingPrevs loop
This commit is contained in:
parent
fca342101e
commit
2ef90a65d9
|
|
@ -306,6 +306,14 @@ func (u *latestEventsUpdater) calculateLatest(
|
|||
delete(existingRefs, prevEventID)
|
||||
}
|
||||
|
||||
// Ensure that we don't add any candidate forward extremities from
|
||||
// the old set that are, themselves, referenced by the old set of
|
||||
// forward extremities. This shouldn't happen but guards against
|
||||
// the possibility anyway.
|
||||
for prevEventID := range existingPrevs {
|
||||
delete(existingRefs, prevEventID)
|
||||
}
|
||||
|
||||
// Then re-add any old extremities that are still valid after all.
|
||||
for _, old := range existingRefs {
|
||||
newLatest = append(newLatest, *old)
|
||||
|
|
|
|||
Loading…
Reference in a new issue