wtdb: rename CSessionInactive to CSessionTerminal

Since we will now change this to mean that the session should not ever
be activated again.
This commit is contained in:
Elle Mouton committed 2024-02-20 14:44:11 +02:00
1 parent 26432359ad
commit 5cb8c8df7e
3 files changed
+7 -7

No files matched your search

+1 -1
View File
@@ -578,7 +578,7 @@ func (c *ClientDB) RemoveTower(pubKey *btcec.PublicKey, addr net.Addr) error {
return ErrTowerUnackedUpdates return ErrTowerUnackedUpdates
} }
err := markSessionStatus( err := markSessionStatus(
sessions, session, CSessionInactive, sessions, session, CSessionTerminal,
) )
if err != nil { if err != nil {
return err return err
+3 -3
View File
@@ -146,10 +146,10 @@ func (h *clientDBHarness) removeTower(pubKey *btcec.PublicKey, addr net.Addr,
} }
for _, session := range h.listSessions(&tower.ID) { for _, session := range h.listSessions(&tower.ID) {
require.Equal(h.t, wtdb.CSessionInactive, require.Equal(h.t, wtdb.CSessionTerminal,
session.Status, "expected status for session "+ session.Status, "expected status for session "+
"%v to be %v, got %v", session.ID, "%v to be %v, got %v", session.ID,
wtdb.CSessionInactive, session.Status) wtdb.CSessionTerminal, session.Status)
} }
} }
} }
@@ -617,7 +617,7 @@ func testTowerStatusChange(h *clientDBHarness) {
// to inactive. // to inactive.
h.removeTower(tower.IdentityKey, nil, true, nil) h.removeTower(tower.IdentityKey, nil, true, nil)
assertTowerStatus(wtdb.TowerStatusInactive) assertTowerStatus(wtdb.TowerStatusInactive)
assertSessionStatus(wtdb.CSessionInactive) assertSessionStatus(wtdb.CSessionTerminal)
// Re-adding the tower in some way should re-active it and its session. // Re-adding the tower in some way should re-active it and its session.
h.createTower(towerAddr, nil) h.createTower(towerAddr, nil)
+3 -3
View File
@@ -18,9 +18,9 @@ const (
// used for backups. // used for backups.
CSessionActive CSessionStatus = 0 CSessionActive CSessionStatus = 0
// CSessionInactive indicates that the ClientSession is inactive and // CSessionTerminal indicates that the ClientSession is in a terminal
// cannot be used for backups. // state and cannot be used for backups.
CSessionInactive CSessionStatus = 1 CSessionTerminal CSessionStatus = 1
) )
// ClientSession encapsulates a SessionInfo returned from a successful // ClientSession encapsulates a SessionInfo returned from a successful