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

+2
View File
@@ -7,6 +7,7 @@ import (
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration2"
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration3"
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration4"
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration5"
)
// log is a logger that is initialized with no output filters. This
@@ -34,6 +35,7 @@ func UseLogger(logger btclog.Logger) {
migration2.UseLogger(logger)
migration3.UseLogger(logger)
migration4.UseLogger(logger)
migration5.UseLogger(logger)
}
// logClosure is used to provide a closure over expensive logging operations so