Don't store our own keys in the database

This commit is contained in:
Neil Alexander 2020-06-15 14:21:18 +01:00
parent 5e01375637
commit 811c2d8162

View file

@ -147,13 +147,17 @@ func (s *ServerKeyAPI) FetchKeys(
if res.ValidUntilTS > prev.ValidUntilTS {
// This key is newer than the one we had so let's store
// it in the database.
if req.ServerName != s.Cfg.Matrix.ServerName {
storeResults[req] = res
}
}
} else {
// We didn't already have a previous entry for this request
// so store it in the database anyway for now.
if req.ServerName != s.Cfg.Matrix.ServerName {
storeResults[req] = res
}
}
// Update the results map with this new result. If nothing
// else, we can try verifying against this key.
results[req] = res