mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-01 19:10:59 +02:00
routing: close graph session if getBandwidthHints fails
Ensure that the graph session used during pathfinding is properly closed if the call to getBandwidthHints fails.
This commit is contained in:
@ -294,6 +294,12 @@ func (p *paymentSession) RequestRoute(maxAmt, feeLimit lnwire.MilliSatoshi,
|
|||||||
// attempt, because concurrent payments may change balances.
|
// attempt, because concurrent payments may change balances.
|
||||||
bandwidthHints, err := p.getBandwidthHints(graph)
|
bandwidthHints, err := p.getBandwidthHints(graph)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// Close routing graph session.
|
||||||
|
if graphErr := closeGraph(); graphErr != nil {
|
||||||
|
log.Errorf("could not close graph session: %v",
|
||||||
|
graphErr)
|
||||||
|
}
|
||||||
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user