@@ -463,6 +463,7 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
463
463
network_update : Option < NetworkUpdate > ,
464
464
short_channel_id : Option < u64 > ,
465
465
payment_failed_permanently : bool ,
466
+ failed_within_blinded_path : bool ,
466
467
}
467
468
let mut res: Option < FailureLearnings > = None ;
468
469
let mut htlc_msat = * first_hop_htlc_msat;
@@ -488,7 +489,8 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
488
489
error_code_ret = Some ( BADONION | PERM | 24 ) ; // invalid_onion_blinding
489
490
error_packet_ret = Some ( vec ! [ 0 ; 32 ] ) ;
490
491
res = Some ( FailureLearnings {
491
- network_update : None , short_channel_id : None , payment_failed_permanently : false
492
+ network_update : None , short_channel_id : None , payment_failed_permanently : false ,
493
+ failed_within_blinded_path : true ,
492
494
} ) ;
493
495
return
494
496
} ,
@@ -520,7 +522,8 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
520
522
}
521
523
522
524
res = Some ( FailureLearnings {
523
- network_update : None , short_channel_id : None , payment_failed_permanently : false
525
+ network_update : None , short_channel_id : None , payment_failed_permanently : false ,
526
+ failed_within_blinded_path : true ,
524
527
} ) ;
525
528
return
526
529
}
@@ -550,7 +553,8 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
550
553
} ) ;
551
554
let short_channel_id = Some ( route_hop. short_channel_id ) ;
552
555
res = Some ( FailureLearnings {
553
- network_update, short_channel_id, payment_failed_permanently : is_from_final_node
556
+ network_update, short_channel_id, payment_failed_permanently : is_from_final_node,
557
+ failed_within_blinded_path : false
554
558
} ) ;
555
559
return
556
560
}
@@ -706,7 +710,8 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
706
710
707
711
res = Some ( FailureLearnings {
708
712
network_update, short_channel_id,
709
- payment_failed_permanently : error_code & PERM == PERM && is_from_final_node
713
+ payment_failed_permanently : error_code & PERM == PERM && is_from_final_node,
714
+ failed_within_blinded_path : false
710
715
} ) ;
711
716
712
717
let ( description, title) = errors:: get_onion_error_description ( error_code) ;
@@ -717,7 +722,7 @@ pub(super) fn process_onion_failure<T: secp256k1::Signing, L: Deref>(
717
722
}
718
723
} ) . expect ( "Route that we sent via spontaneously grew invalid keys in the middle of it?" ) ;
719
724
if let Some ( FailureLearnings {
720
- network_update, short_channel_id, payment_failed_permanently
725
+ network_update, short_channel_id, payment_failed_permanently, failed_within_blinded_path
721
726
} ) = res {
722
727
DecodedOnionFailure {
723
728
network_update, short_channel_id, payment_failed_permanently,
0 commit comments