routing: remove pathfinding db tx

Pathfinding is never used with an externally supplied bbolt transaction.
This commit is contained in:
Joost Jager 2020-01-27 13:19:08 +01:00
parent 2cd26d7556
commit a8ed1b342a
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -271,10 +271,6 @@ func edgeWeight(lockedAmt lnwire.MilliSatoshi, fee lnwire.MilliSatoshi,
// graphParams wraps the set of graph parameters passed to findPath.
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 *channeldb.ChannelGraph
@ -425,14 +421,12 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
}
self := selfNode.PubKeyBytes
tx := g.tx
if tx == nil {
tx, err = g.graph.Database().Begin(false)
if err != nil {
return nil, err
}
defer tx.Rollback()
// Get a db transaction to execute the graph queries in.
tx, err := g.graph.Database().Begin(false)
if err != nil {
return nil, err
}
defer tx.Rollback()
// If no destination features are provided, we will load what features
// we have for the target node from our graph.