routing: remove pathfinding db tx
Pathfinding is never used with an externally supplied bbolt transaction.
This commit is contained in:
parent
2cd26d7556
commit
a8ed1b342a
@ -271,10 +271,6 @@ func edgeWeight(lockedAmt lnwire.MilliSatoshi, fee lnwire.MilliSatoshi,
|
|||||||
|
|
||||||
// graphParams wraps the set of graph parameters passed to findPath.
|
// graphParams wraps the set of graph parameters passed to findPath.
|
||||||
type graphParams struct {
|
type graphParams struct {
|
||||||
// tx can be set to an existing db transaction. If not set, a new
|
|
||||||
// transaction will be started.
|
|
||||||
tx *bbolt.Tx
|
|
||||||
|
|
||||||
// graph is the ChannelGraph to be used during path finding.
|
// graph is the ChannelGraph to be used during path finding.
|
||||||
graph *channeldb.ChannelGraph
|
graph *channeldb.ChannelGraph
|
||||||
|
|
||||||
@ -425,14 +421,12 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
|
|||||||
}
|
}
|
||||||
self := selfNode.PubKeyBytes
|
self := selfNode.PubKeyBytes
|
||||||
|
|
||||||
tx := g.tx
|
// Get a db transaction to execute the graph queries in.
|
||||||
if tx == nil {
|
tx, err := g.graph.Database().Begin(false)
|
||||||
tx, err = g.graph.Database().Begin(false)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer tx.Rollback()
|
defer tx.Rollback()
|
||||||
}
|
|
||||||
|
|
||||||
// If no destination features are provided, we will load what features
|
// If no destination features are provided, we will load what features
|
||||||
// we have for the target node from our graph.
|
// we have for the target node from our graph.
|
||||||
|
Loading…
Reference in New Issue
Block a user