lnd+kvdb: pass LND abort context to etcd
This commit is contained in:
1 parent
d3545830c9
commit
3e5e60cac4
4 files changed
+19
-10
No files matched your search
+4
-3
@@ -1,6 +1,7 @@
|
||||
package lncfg
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/lightningnetwork/lnd/channeldb/kvdb"
|
||||
@@ -50,12 +51,12 @@ func (db *DB) Validate() error {
|
||||
}
|
||||
|
||||
// GetBackend returns a kvdb.Backend as set in the DB config.
|
||||
func (db *DB) GetBackend(dbPath string, networkName string) (
|
||||
kvdb.Backend, error) {
|
||||
func (db *DB) GetBackend(ctx context.Context, dbPath string,
|
||||
networkName string) (kvdb.Backend, error) {
|
||||
|
||||
if db.Backend == etcdBackend {
|
||||
// Prefix will separate key/values in the db.
|
||||
return kvdb.GetEtcdBackend(networkName, db.Etcd)
|
||||
return kvdb.GetEtcdBackend(ctx, networkName, db.Etcd)
|
||||
}
|
||||
|
||||
return kvdb.GetBoltBackend(dbPath, dbName, db.Bolt.NoFreeListSync)
|
||||
|
||||
Reference in new issue
Block a user