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
/// Includes a payment expiration in seconds relative to the UNIX epoch.
@@ -572,6 +590,16 @@ impl PaymentParameters {
572
590
}
573
591
}
574
592
593
+
/// Routing hints for the tail of the route.
594
+
#[derive(Clone,Debug,Hash,PartialEq,Eq)]
595
+
pubenumHints{
596
+
/// The recipient provided blinded paths and payinfo to reach them. The blinded paths themselves
597
+
/// will be included in the final [`Route`].
598
+
Blinded(Vec<(BlindedPayInfo,BlindedPath)>),
599
+
/// The recipient included these route hints in their BOLT11 invoice.
600
+
Clear(Vec<RouteHint>),
601
+
}
602
+
575
603
/// A list of hops along a payment path terminating with a channel to the recipient.
576
604
#[derive(Clone,Debug,Hash,Eq,PartialEq)]
577
605
pubstructRouteHint(pubVec<RouteHintHop>);
@@ -1021,12 +1049,17 @@ where L::Target: Logger {
1021
1049
returnErr(LightningError{err:"Cannot send a payment of 0 msat".to_owned(),action:ErrorAction::IgnoreError});
1022
1050
}
1023
1051
1024
-
for route in payment_params.route_hints.iter(){
1025
-
for hop in&route.0{
1026
-
if hop.src_node_id == payment_params.payee_pubkey{
1027
-
returnErr(LightningError{err:"Route hint cannot have the payee as the source.".to_owned(),action:ErrorAction::IgnoreError});
1052
+
match&payment_params.route_hints{
1053
+
Hints::Clear(hints) => {
1054
+
for route in hints.iter(){
1055
+
for hop in&route.0{
1056
+
if hop.src_node_id == payment_params.payee_pubkey{
1057
+
returnErr(LightningError{err:"Route hint cannot have the payee as the source.".to_owned(),action:ErrorAction::IgnoreError});
1058
+
}
1059
+
}
1028
1060
}
1029
-
}
1061
+
},
1062
+
_ => todo!()
1030
1063
}
1031
1064
if payment_params.max_total_cltv_expiry_delta <= final_cltv_expiry_delta {
1032
1065
returnErr(LightningError{err:"Can't find a route where the maximum total CLTV expiry delta is below the final CLTV expiry.".to_owned(),action:ErrorAction::IgnoreError});
@@ -1551,7 +1584,11 @@ where L::Target: Logger {
1551
1584
// If a caller provided us with last hops, add them to routing targets. Since this happens
1552
1585
// earlier than general path finding, they will be somewhat prioritized, although currently
1553
1586
// it matters only if the fees are exactly the same.
1554
-
for route in payment_params.route_hints.iter().filter(|route| !route.0.is_empty()){
1587
+
let route_hints = match&payment_params.route_hints{
1588
+
Hints::Clear(hints) => hints,
1589
+
_ => todo!()
1590
+
};
1591
+
for route in route_hints.iter().filter(|route| !route.0.is_empty()){
1555
1592
let first_hop_in_route = &(route.0)[0];
1556
1593
let have_hop_src_in_graph =
1557
1594
// Only add the hops in this route to our candidate set if either
0 commit comments