wtdb: add a DeactivateTower method

This new method sets the tower's status to inactive so that it is not
loaded at startup as a candidate tower. We also ensure that a tower's
status is set to active if the CreateTower is called when the tower
already exists.
This commit is contained in:
Elle Mouton
2023-11-27 13:23:18 +02:00
parent 0bb1816fff
commit 4548e72f79
3 changed files with 159 additions and 5 deletions

View File

@@ -140,6 +140,11 @@ type DB interface {
// DeleteCommittedUpdates deletes all the committed updates belonging to
// the given session from the db.
DeleteCommittedUpdates(id *wtdb.SessionID) error
// DeactivateTower sets the given tower's status to inactive. This means
// that this tower's sessions won't be loaded and used for backups.
// CreateTower can be used to reactivate the tower again.
DeactivateTower(pubKey *btcec.PublicKey) error
}
// AuthDialer connects to a remote node using an authenticated transport, such