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
2023-11-28 18:28:52 +02:00
parent 26432359ad
commit 5cb8c8df7e
3 changed files with 7 additions and 7 deletions

View File

@@ -578,7 +578,7 @@ func (c *ClientDB) RemoveTower(pubKey *btcec.PublicKey, addr net.Addr) error {
return ErrTowerUnackedUpdates
}
err := markSessionStatus(
sessions, session, CSessionInactive,
sessions, session, CSessionTerminal,
)
if err != nil {
return err

View File

@@ -146,10 +146,10 @@ func (h *clientDBHarness) removeTower(pubKey *btcec.PublicKey, addr net.Addr,
}
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 "+
"%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.
h.removeTower(tower.IdentityKey, nil, true, nil)
assertTowerStatus(wtdb.TowerStatusInactive)
assertSessionStatus(wtdb.CSessionInactive)
assertSessionStatus(wtdb.CSessionTerminal)
// Re-adding the tower in some way should re-active it and its session.
h.createTower(towerAddr, nil)

View File

@@ -18,9 +18,9 @@ const (
// used for backups.
CSessionActive CSessionStatus = 0
// CSessionInactive indicates that the ClientSession is inactive and
// cannot be used for backups.
CSessionInactive CSessionStatus = 1
// CSessionTerminal indicates that the ClientSession is in a terminal
// state and cannot be used for backups.
CSessionTerminal CSessionStatus = 1
)
// ClientSession encapsulates a SessionInfo returned from a successful