From 811c2d8162674d4456b1ea71d72ae6afffb482a9 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Mon, 15 Jun 2020 14:21:18 +0100 Subject: [PATCH] Don't store our own keys in the database --- serverkeyapi/internal/api.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/serverkeyapi/internal/api.go b/serverkeyapi/internal/api.go index 2be7ae794..a2211a037 100644 --- a/serverkeyapi/internal/api.go +++ b/serverkeyapi/internal/api.go @@ -147,12 +147,16 @@ 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. - storeResults[req] = res + 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. - storeResults[req] = res + 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.