You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure we don't ever retry a payment along a just-failed path
If we try to pay a mobile client behind an LSP, its not strange for
the singular last-hop hint to fail with a Temporary Channel Failure
(indicating the mobile app is not currently open and connected to
the LSP). In this case, we will penalize the last-hop channel but
try again along the same path anyway, because we have no other
path. This changes the retryer to simply refuse to do so, failing
the payment instead.
Fixes#1241.
let chan_1_scid = create_announced_chan_between_nodes_with_value(&nodes,0,1,10_000_000,0,InitFeatures::known(),InitFeatures::known()).0.contents.short_channel_id;
1636
1682
let chan_2_scid = create_announced_chan_between_nodes_with_value(&nodes,1,2,10_000_000,0,InitFeatures::known(),InitFeatures::known()).0.contents.short_channel_id;
1683
+
let chan_3_scid = create_announced_chan_between_nodes_with_value(&nodes,0,1,10_000_000,0,InitFeatures::known(),InitFeatures::known()).0.contents.short_channel_id;
1684
+
let chan_4_scid = create_announced_chan_between_nodes_with_value(&nodes,1,2,10_000_000,0,InitFeatures::known(),InitFeatures::known()).0.contents.short_channel_id;
1637
1685
1638
1686
letmut route = Route{
1639
1687
paths:vec![
@@ -1672,8 +1720,11 @@ mod tests {
1672
1720
};
1673
1721
let router = ManualRouter(RefCell::new(VecDeque::new()));
1674
1722
router.expect_find_route(Ok(route.clone()));
1675
-
// On retry, we'll only be asked for one path
1723
+
// On retry, we'll only be asked for one path. We also give it a diffferent SCID set as the
1724
+
// InvoicePayer will refuse to retry using a just-failed channel.
1676
1725
route.paths.remove(1);
1726
+
route.paths[0][0].short_channel_id = chan_3_scid;
1727
+
route.paths[0][1].short_channel_id = chan_4_scid;
1677
1728
router.expect_find_route(Ok(route.clone()));
1678
1729
1679
1730
let expected_events:RefCell<VecDeque<&dynFn(&Event)>> = RefCell::new(VecDeque::new());
0 commit comments