watchtower/wtdb: add tower-to-session index entry for all towers

In this commit, a small migration is added to the watchtower client DB
to ensure that there is an entry in the towerID-to-sessionID index for
all towers in the db regardless of if they have sessions or not. This is
required as a follow up to migration 1 since that migration only created
entries in the index for towers that had associated sessions which would
lead to "tower not found" errors on start up.
This commit is contained in:
Elle Mouton committed 2023-03-08 11:00:40 +02:00
1 parent d26cfd241a
commit f6ef3db6ea
7 files changed
+313 -1

No files matched your search

+4 -1
View File
@@ -406,7 +406,10 @@ in the lnwire package](https://github.com/lightningnetwork/lnd/pull/7303)
speed of listing sessions for a particular tower ID](
https://github.com/lightningnetwork/lnd/pull/6972). This PR also ensures a
closer coupling of Towers and Sessions and ensures that a session cannot be
added if the tower it is referring to does not exist.
added if the tower it is referring to does not exist. A [follow-up migration
was added](https://github.com/lightningnetwork/lnd/pull/7491) to ensure that
entries are added to the new index for _all_ towers in the db, including those
for which there are not yet associated sessions.
* [Remove `AckedUpdates` & `CommittedUpdates` from the `ClientSession`
struct](https://github.com/lightningnetwork/lnd/pull/6928) in order to