@@ -11,7 +11,6 @@ import (
11
11
"github.com/btcsuite/btcd/wire"
12
12
"github.com/lightningnetwork/lnd/batch"
13
13
"github.com/lightningnetwork/lnd/graph/db/models"
14
- "github.com/lightningnetwork/lnd/kvdb"
15
14
"github.com/lightningnetwork/lnd/lnwire"
16
15
"github.com/lightningnetwork/lnd/routing/route"
17
16
)
@@ -20,18 +19,6 @@ import (
20
19
// busy shutting down.
21
20
var ErrChanGraphShuttingDown = fmt .Errorf ("ChannelGraph shutting down" )
22
21
23
- // Config is a struct that holds all the necessary dependencies for a
24
- // ChannelGraph.
25
- type Config struct {
26
- // KVDB is the kvdb.Backend that will be used for initializing the
27
- // KVStore CRUD layer.
28
- KVDB kvdb.Backend
29
-
30
- // KVStoreOpts is a list of functional options that will be used when
31
- // initializing the KVStore.
32
- KVStoreOpts []KVStoreOptionModifier
33
- }
34
-
35
22
// ChannelGraph is a layer above the graph's CRUD layer.
36
23
//
37
24
// NOTE: currently, this is purely a pass-through layer directly to the backing
@@ -56,21 +43,16 @@ type ChannelGraph struct {
56
43
}
57
44
58
45
// NewChannelGraph creates a new ChannelGraph instance with the given backend.
59
- func NewChannelGraph (cfg * Config , options ... ChanGraphOption ) ( * ChannelGraph ,
60
- error ) {
46
+ func NewChannelGraph (v1Store V1Store ,
47
+ options ... ChanGraphOption ) ( * ChannelGraph , error ) {
61
48
62
49
opts := defaultChanGraphOptions ()
63
50
for _ , o := range options {
64
51
o (opts )
65
52
}
66
53
67
- store , err := NewKVStore (cfg .KVDB , cfg .KVStoreOpts ... )
68
- if err != nil {
69
- return nil , err
70
- }
71
-
72
54
g := & ChannelGraph {
73
- V1Store : store ,
55
+ V1Store : v1Store ,
74
56
topologyManager : newTopologyManager (),
75
57
quit : make (chan struct {}),
76
58
}
0 commit comments