Fix resolve-state

This commit is contained in:
Neil Alexander 2021-04-15 09:38:55 +01:00
parent b7cf702a14
commit 7b2e141fa9
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -50,23 +50,18 @@ func main() {
panic(err) panic(err)
} }
blockNIDs, err := roomserverDB.StateBlockNIDs(ctx, snapshotNIDs) var stateEntries [][]types.StateEntry
if err != nil { for _, nid := range snapshotNIDs {
panic(err) entries, err2 := roomserverDB.StateEntries(ctx, nid)
}
var stateEntries []types.StateEntryList
for _, list := range blockNIDs {
entries, err2 := roomserverDB.StateEntries(ctx, list.StateBlockNIDs)
if err2 != nil { if err2 != nil {
panic(err2) panic(err2)
} }
stateEntries = append(stateEntries, entries...) stateEntries = append(stateEntries, entries)
} }
var eventNIDs []types.EventNID var eventNIDs []types.EventNID
for _, entry := range stateEntries { for _, list := range stateEntries {
for _, e := range entry.StateEntries { for _, e := range list {
eventNIDs = append(eventNIDs, e.EventNID) eventNIDs = append(eventNIDs, e.EventNID)
} }
} }