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. // 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.