multi: use kvdb.Backend for height hint DB

In order to separate our databases more clearly, we refactor the height
hint cache DB to use a kvdb backend instead of the channel DB instance
directly.
This commit is contained in:
Oliver Gugger committed 2021-08-04 14:55:51 +02:00
1 parent 9138c8abac
commit c4917ae7fc
4 files changed
+26 -14

No files matched your search

+7 -2
View File
@@ -91,6 +91,10 @@ type DatabaseBackends struct {
// ChanStateDB points to a possibly networked replicated backend that
// contains the critical channel state related data.
ChanStateDB kvdb.Backend
// HeightHintDB points to a possibly networked replicated backend that
// contains the chain height hint related data.
HeightHintDB kvdb.Backend
}
// GetBackends returns a set of kvdb.Backends as set in the DB config.
@@ -124,8 +128,9 @@ func (db *DB) GetBackends(ctx context.Context, dbPath string) (
}
return &DatabaseBackends{
GraphDB: localDB,
ChanStateDB: remoteDB,
GraphDB: localDB,
ChanStateDB: remoteDB,
HeightHintDB: localDB,
}, nil
}