Clean up a bit

This commit is contained in:
Neil Alexander 2021-04-16 14:01:37 +01:00
parent 8c2bb18697
commit b4d1ebf54a
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
2 changed files with 0 additions and 26 deletions

View file

@ -25,7 +25,6 @@ import (
"github.com/matrix-org/dendrite/roomserver/storage"
"github.com/matrix-org/util"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
"github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/gomatrixserverlib"
@ -62,18 +61,14 @@ func (v *StateResolution) LoadStateAtSnapshot(
if err != nil {
return nil, err
}
logrus.Warn("LISTS: ", stateEntryLists)
stateEntriesMap := stateEntryListMap(stateEntryLists)
logrus.Warn("Map: ", stateEntriesMap)
// Combine all the state entries for this snapshot.
// The order of state block NIDs in the list tells us the order to combine them in.
var fullState []types.StateEntry
for _, stateBlockNID := range stateBlockNIDList.StateBlockNIDs {
logrus.Warn("Looking up ", stateBlockNID)
entries, ok := stateEntriesMap.lookup(stateBlockNID)
if !ok {
logrus.Warnf("State block NID %d: %+v", stateBlockNID, entries)
// This should only get hit if the database is corrupt.
// It should be impossible for an event to reference a NID that doesn't exist
panic(fmt.Errorf("Corrupt DB: Missing state block numeric ID %d", stateBlockNID))