watchtower: add filter function to ListTowers
And then only load active towers on client start up.
This commit is contained in:
4 files changed
+22
-6
No files matched your search
@@ -261,7 +261,10 @@ func getTowerAndSessionCandidates(db DB, keyRing ECDHKeyRing,
|
||||
opts ...wtdb.ClientSessionListOption) (
|
||||
map[wtdb.SessionID]*ClientSession, error) {
|
||||
|
||||
towers, err := db.ListTowers()
|
||||
// Fetch all active towers from the DB.
|
||||
towers, err := db.ListTowers(func(tower *wtdb.Tower) bool {
|
||||
return tower.Status == wtdb.TowerStatusActive
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user