wtclient+lnrpc: move RemoveTower to Manager

Simiarly to the previous commit, this commit moves the RemoveTower
method from the Client to the TowerClientManager interface. The manager
handles any DB related handling. The manager will first attempt to
remove the tower from the in-memory state of each client and then will
attempt to remove the tower from the DB. If the removal from the DB
fails, the manager will re-add the tower to the in-memory state of each
client.
This commit is contained in:
Elle Mouton committed 2023-11-28 09:54:02 +02:00
1 parent a44bf381c4
commit a5e7d35af2
4 files changed
+77 -69

No files matched your search

+1 -6
View File
@@ -243,12 +243,7 @@ func (c *WatchtowerClient) RemoveTower(ctx context.Context,
}
}
// TODO(conner): make atomic via multiplexed client
err = c.cfg.Client.RemoveTower(pubKey, addr)
if err != nil {
return nil, err
}
err = c.cfg.AnchorClient.RemoveTower(pubKey, addr)
err = c.cfg.ClientMgr.RemoveTower(pubKey, addr)
if err != nil {
return nil, err
}