watchtower/wtdb: remove unnecessary tower load

This commit is contained in:
Elle Mouton 2022-10-21 13:19:48 +02:00
parent ee0353dd24
commit 5283e2c341
No known key found for this signature in database
GPG Key ID: D7D916376026F177

View File

@ -1023,20 +1023,14 @@ func (c *ClientDB) ListClientSessions(id *TowerID,
return ErrUninitializedDB
}
towers := tx.ReadBucket(cTowerBkt)
if towers == nil {
return ErrUninitializedDB
}
chanIDIndexBkt := tx.ReadBucket(cChanIDIndexBkt)
if chanIDIndexBkt == nil {
return ErrUninitializedDB
}
var err error
// If no tower ID is specified, then fetch all the sessions
// known to the db.
var err error
if id == nil {
clientSessions, err = c.listClientAllSessions(
sessions, chanIDIndexBkt, filterFn, opts...,