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
2021-08-03 09:57:27 +02:00
parent 9138c8abac
commit c4917ae7fc
4 changed files with 26 additions and 14 deletions

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
}