mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-18 01:56:55 +01:00
graph: add ReadOnlyGraph interface to GraphSource interface
In this commit, we take the existing graphsession.ReadyOnlyGraph interface and remove its usage of a kvdb.RTx and replace it with a more abstract `RTx` interface type. The new GraphSource interface is expanded to include the graphsession.ReadOnlyGraph interface and the implementation of it, DBSource, is expanded to include the new methods. It converts the given RTx to the underlying kvdb read transaction where needed.
This commit is contained in:
@@ -1026,7 +1026,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
}
|
||||
paymentSessionSource := &routing.SessionSource{
|
||||
GraphSessionFactory: graphsession.NewGraphSessionFactory(
|
||||
dbs.GraphDB,
|
||||
graphSource,
|
||||
),
|
||||
SourceNode: sourceNode,
|
||||
MissionControl: s.defaultMC,
|
||||
@@ -1060,7 +1060,7 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
|
||||
s.chanRouter, err = routing.New(routing.Config{
|
||||
SelfNode: selfNode.PubKeyBytes,
|
||||
RoutingGraph: graphsession.NewRoutingGraph(dbs.GraphDB),
|
||||
RoutingGraph: graphsession.NewRoutingGraph(graphSource),
|
||||
Chain: cc.ChainIO,
|
||||
Payer: s.htlcSwitch,
|
||||
Control: s.controlTower,
|
||||
|
||||
Reference in New Issue
Block a user