multi: add watchtower client RPC subserver #3184
In this PR, we introduce a new RPC subserver:
The text was updated successfully, but these errors were encountered:
The state updates that are pending to be acked by the tower are already loaded within newSessionQueue.
This currently takes O(N) time as there does not exist an index of active client sessions for each watchtower within the client's database. This index is likely to be added in the future.
These operations are currently unused, but will be integrated into the TowerClient at a later point as future preparation for the WatchtowerClient RPC subserver, which will allow users to add, remove, and list the watchtowers currntly in use.
In this commit, we extend the wtclient.Client interface with the following methods: * AddTower * RemoveTower * RegisteredTowers * LookupTower * Stats Care has been taken to ensure that any in-memory state updates are _only_ performed after a successful database update. These methods are currently unused, but they serve as a dependency for the upcoming WatchtowerClient RPC subserver.
We do this as a convenience for WatchtowerClient users so that they do not need to re-add towers upon restarts. We ensure not to re-add towers that have been previously removed by determining whether it has any lingering active sessions.
With the introduction of the WatchtowerClient RPC subserver, the lnd configuration flag to specify private watchtowers for the client is no longer needed and can lead to confusion upon users. Therefore, we remove the flag completely, and only rely on the watchtower client being active through a new --wtclient.active flag.