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:
4 files changed
+77
-69
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user