File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1383,6 +1383,15 @@ impl<'a> CandidateRouteHop<'a> {
1383
1383
_ => None ,
1384
1384
}
1385
1385
}
1386
+ fn blinded_hint_idx ( & self ) -> Option < usize > {
1387
+ match self {
1388
+ Self :: Blinded ( BlindedPathCandidate { hint_idx, .. } ) |
1389
+ Self :: OneHopBlinded ( OneHopBlindedPathCandidate { hint_idx, .. } ) => {
1390
+ Some ( * hint_idx)
1391
+ } ,
1392
+ _ => None ,
1393
+ }
1394
+ }
1386
1395
/// Returns the source node id of current hop.
1387
1396
///
1388
1397
/// Source node id refers to the node forwarding the HTLC through this hop.
@@ -2134,8 +2143,15 @@ where L::Target: Logger {
2134
2143
( amount_to_transfer_over_msat < $next_hops_path_htlc_minimum_msat &&
2135
2144
recommended_value_msat >= $next_hops_path_htlc_minimum_msat) ) ;
2136
2145
2137
- let payment_failed_on_this_channel = scid_opt. map_or( false ,
2138
- |scid| payment_params. previously_failed_channels. contains( & scid) ) ;
2146
+ let payment_failed_on_this_channel = match scid_opt {
2147
+ Some ( scid) => payment_params. previously_failed_channels. contains( & scid) ,
2148
+ None => match $candidate. blinded_hint_idx( ) {
2149
+ Some ( idx) => {
2150
+ payment_params. previously_failed_blinded_path_idxs. contains( & ( idx as u64 ) )
2151
+ } ,
2152
+ None => false ,
2153
+ } ,
2154
+ } ;
2139
2155
2140
2156
let ( should_log_candidate, first_hop_details) = match $candidate {
2141
2157
CandidateRouteHop :: FirstHop ( hop) => ( true , Some ( hop. details) ) ,
You can’t perform that action at this time.
0 commit comments