watchtower: extend client db to filter sessions for a specific tower

This currently takes O(N) time as there does not exist an index of
active client sessions for each watchtower within the client's database.
This index is likely to be added in the future.
This commit is contained in:
Wilmer Paulino committed 2019-07-30 15:13:22 -07:00
1 parent 4abadc82f3
commit 56d66c80a1
5 files changed
+111 -29

No files matched your search

+1 -1
View File
@@ -206,7 +206,7 @@ func New(config *Config) (*TowerClient, error) {
// use any of these session if their policies match the current policy
// of the client, otherwise they will be ignored and new sessions will
// be requested.
sessions, err := cfg.DB.ListClientSessions()
sessions, err := cfg.DB.ListClientSessions(nil)
if err != nil {
return nil, err
}