Skip to content

Commit d1c54d7

Browse files
committed
routing: close graph session if getBandwidthHints fails
Ensure that the graph session used during pathfinding is properly closed if the call to getBandwidthHints fails.
1 parent 90dff73 commit d1c54d7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

routing/payment_session.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ func (p *paymentSession) RequestRoute(maxAmt, feeLimit lnwire.MilliSatoshi,
294294
// attempt, because concurrent payments may change balances.
295295
bandwidthHints, err := p.getBandwidthHints(graph)
296296
if err != nil {
297+
// Close routing graph session.
298+
if graphErr := closeGraph(); graphErr != nil {
299+
log.Errorf("could not close graph session: %v",
300+
graphErr)
301+
}
302+
297303
return nil, err
298304
}
299305

0 commit comments

Comments
 (0)