From 75c2ebd79475e793c76daa6d20468e55a00127a4 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Mon, 11 May 2020 15:26:12 -0700 Subject: [PATCH] wtclient: load missing info into client sessions upon new tower This addresses a potential panic in where we relied on this missing info being populated. --- watchtower/wtclient/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/watchtower/wtclient/client.go b/watchtower/wtclient/client.go index 8a37abe5..6827cdca 100644 --- a/watchtower/wtclient/client.go +++ b/watchtower/wtclient/client.go @@ -1060,7 +1060,9 @@ func (c *TowerClient) handleNewTower(msg *newTowerMsg) error { c.candidateTowers.AddCandidate(tower) // Include all of its corresponding sessions to our set of candidates. - sessions, err := c.cfg.DB.ListClientSessions(&tower.ID) + sessions, err := getClientSessions( + c.cfg.DB, c.cfg.SecretKeyRing, &tower.ID, nil, + ) if err != nil { return fmt.Errorf("unable to determine sessions for tower %x: "+ "%v", tower.IdentityKey.SerializeCompressed(), err)