Skip to content

Commit df75453

Browse files
committed
Add missing break when scoring a path with a missing channel
If we send payments over a path where a channel ended up being closed, we'll remove it before we call `ProbabilisticPaymentScorer::payment_path_failed`. This should be fine, except that `payment_path_failed` does not break out of its scoring loop if a channel is missing, causing it to assign a minimum available-liquidity of the payment amount even to channels which our attempt never arrived at. The fix is simple - add the missing check and break.
1 parent 6957fb6 commit df75453

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lightning/src/routing/scoring.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,7 @@ impl<G: Deref<Target = NetworkGraph<L>>, L: Deref, T: Time> Score for Probabilis
11671167
} else {
11681168
log_debug!(self.logger, "Not able to penalize channel with SCID {} as we do not have graph info for it (likely a route-hint last-hop).",
11691169
hop.short_channel_id);
1170+
if hop.short_channel_id == short_channel_id { break; }
11701171
}
11711172
}
11721173
}

0 commit comments

Comments
 (0)