multi: make decayed log DB remote compatible

Even though the sphinx router's persistent replay log is not crucial in
the operation of lnd as its state can be re-created by creating a new
brontide connection, we want to make lnd fully stateless and therefore
have the option of not storing any state on disk.
This commit is contained in:
Oliver Gugger
2021-08-03 09:57:32 +02:00
parent 6043113857
commit 1e27f491c7
6 changed files with 91 additions and 56 deletions

2
lnd.go
View File

@@ -1616,6 +1616,7 @@ type databaseInstances struct {
chanStateDB *channeldb.DB
heightHintDB kvdb.Backend
macaroonDB kvdb.Backend
decayedLogDB kvdb.Backend
}
// initializeDatabases extracts the current databases that we'll use for normal
@@ -1649,6 +1650,7 @@ func initializeDatabases(ctx context.Context,
dbs := &databaseInstances{
heightHintDB: databaseBackends.HeightHintDB,
macaroonDB: databaseBackends.MacaroonDB,
decayedLogDB: databaseBackends.DecayedLogDB,
}
cleanUp := func() {
// We can just close the returned close functions directly. Even