multi: move AddTower to Tower Client Manager
In this commit we move the AddTower method from the Client interface to the TowerClientManager interface. The wtclientrpc is updated to call the `AddTower` method of the Manager instead of calling the `AddTower` method of each individual client. The TowerClient now is also only concerned with adding a new tower (or new tower address) to its in-memory state; the tower Manager will handle adding the tower to the DB.
This commit is contained in:
7 files changed
+75
-39
No files matched your search
@@ -208,11 +208,7 @@ func (c *WatchtowerClient) AddTower(ctx context.Context,
|
||||
Address: addr,
|
||||
}
|
||||
|
||||
// TODO(conner): make atomic via multiplexed client
|
||||
if err := c.cfg.Client.AddTower(towerAddr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := c.cfg.AnchorClient.AddTower(towerAddr); err != nil {
|
||||
if err := c.cfg.ClientMgr.AddTower(towerAddr); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user