diff --git a/federationapi/routing/send.go b/federationapi/routing/send.go index 36f98f31..66fc7f03 100644 --- a/federationapi/routing/send.go +++ b/federationapi/routing/send.go @@ -483,14 +483,12 @@ func (t *txnReq) getServers(ctx context.Context, roomID string, eventOrigin goma return t.servers } dedupe := map[gomatrixserverlib.ServerName]struct{}{} - count := 1 t.servers = []gomatrixserverlib.ServerName{t.Origin} // transaction origin dedupe[t.Origin] = struct{}{} if eventOrigin != "" { if _, ok := dedupe[eventOrigin]; !ok { t.servers = append(t.servers, eventOrigin) // event origin, if specified dedupe[eventOrigin] = struct{}{} - count++ } } serverReq := &api.QueryServerJoinedToRoomRequest{ @@ -502,8 +500,7 @@ func (t *txnReq) getServers(ctx context.Context, roomID string, eventOrigin goma if _, ok := dedupe[server]; !ok { t.servers = append(t.servers, server) dedupe[server] = struct{}{} - count++ - if count == 10 { + if len(t.servers) == 10 { break } }