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.
This commit is contained in:
Wilmer Paulino 2020-05-11 15:26:12 -07:00
parent 01ab551b22
commit 75c2ebd794
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -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)