watchtower: build channel to sessionIDs index

In this commit, a migration is added that adds an index from channel to
sessionIDs (using the DB-assigned session IDs). This will make it easier
in future to know which sessions have updates for which channels.
This commit is contained in:
Elle Mouton committed 2023-03-20 10:46:52 +02:00
1 parent b16df45076
commit ee0353dd24
7 files changed
+485 -1

No files matched your search

+4
View File
@@ -11,6 +11,7 @@ import (
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration4"
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration5"
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration6"
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration7"
)
// txMigration is a function which takes a prior outdated version of the
@@ -63,6 +64,9 @@ var clientDBVersions = []version{
{
txMigration: migration6.MigrateSessionIDIndex,
},
{
txMigration: migration7.MigrateChannelToSessionIndex,
},
}
// getLatestDBVersion returns the last known database version.