watchtower/wtdb: add new towerID-to-sessionID index

This commit adds a new towerID-to-sessionID index to the wtclient DB.
The commit also contains the necessary migration required in order to
build the index for an existing client.
This index will greatly improve the lookup of sessions for a given tower
ID.
This commit is contained in:
Elle Mouton committed 2022-10-13 11:30:27 +02:00
1 parent c60ecaccbf
commit 354a3b16bd
7 files changed
+620 -2

No files matched your search

+2
View File
@@ -3,6 +3,7 @@ package wtdb
import (
"github.com/btcsuite/btclog"
"github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/watchtower/wtdb/migration1"
)
// log is a logger that is initialized with no output filters. This
@@ -26,6 +27,7 @@ func DisableLog() {
// using btclog.
func UseLogger(logger btclog.Logger) {
log = logger
migration1.UseLogger(logger)
}
// logClosure is used to provide a closure over expensive logging operations so