watchtower: prevent removal of last tower addr
This addresses a potential panic when a tower has one of its candidate sessions chosen, but its only reachable address was removed by a user-initiated RPC before the fact.
This commit is contained in:
5 files changed
+28
-5
No files matched your search
@@ -445,7 +445,7 @@ func testRemoveTower(h *clientDBHarness) {
|
||||
|
||||
// We'll then remove the first address. We should now see that the tower
|
||||
// has no addresses left.
|
||||
h.removeTower(pk, addr1, false, nil)
|
||||
h.removeTower(pk, addr1, false, wtdb.ErrLastTowerAddr)
|
||||
|
||||
// Removing the tower as a whole from the database should succeed since
|
||||
// there aren't any active sessions for it.
|
||||
|
||||
Reference in new issue
Block a user