diff --git a/federationapi/federationapi_keys_test.go b/federationapi/federationapi_keys_test.go index 787bb9945..7ccc02f76 100644 --- a/federationapi/federationapi_keys_test.go +++ b/federationapi/federationapi_keys_test.go @@ -209,7 +209,6 @@ func TestRenewalBehaviour(t *testing.T) { // then repeating a key fetch should cause us to try and renew the key. // If so, then the new key will end up in our cache. serverC.renew() - time.Sleep(time.Second / 2) res, err = serverA.api.FetchKeys( context.Background(), diff --git a/federationapi/internal/keys.go b/federationapi/internal/keys.go index 05612494f..258bd88bf 100644 --- a/federationapi/internal/keys.go +++ b/federationapi/internal/keys.go @@ -99,7 +99,7 @@ func (s *FederationInternalAPI) handleLocalKeys( results map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult, ) { for req := range requests { - if s.cfg.Matrix.IsLocalServerName(req.ServerName) { + if !s.cfg.Matrix.IsLocalServerName(req.ServerName) { continue } if req.KeyID == s.cfg.Matrix.KeyID {