@@ -19,7 +19,7 @@ use crate::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
1919use crate :: ln:: channelmanager:: { ChannelDetails , EventCompletionAction , HTLCSource , PaymentId } ;
2020use crate :: ln:: onion_utils:: { DecodedOnionFailure , HTLCFailReason } ;
2121use crate :: offers:: invoice:: Bolt12Invoice ;
22- use crate :: routing:: router:: { InFlightHtlcs , Path , PaymentParameters , Route , RouteParameters , Router } ;
22+ use crate :: routing:: router:: { BlindedTail , InFlightHtlcs , Path , PaymentParameters , Route , RouteParameters , Router } ;
2323use crate :: util:: errors:: APIError ;
2424use crate :: util:: logger:: Logger ;
2525use crate :: util:: time:: Time ;
@@ -129,6 +129,11 @@ impl PendingOutboundPayment {
129129 params. previously_failed_channels . push ( scid) ;
130130 }
131131 }
132+ pub fn insert_previously_failed_blinded_path ( & mut self , blinded_tail : & BlindedTail ) {
133+ if let PendingOutboundPayment :: Retryable { payment_params : Some ( params) , .. } = self {
134+ params. insert_previously_failed_blinded_path ( blinded_tail) ;
135+ }
136+ }
132137 fn is_awaiting_invoice ( & self ) -> bool {
133138 match self {
134139 PendingOutboundPayment :: AwaitingInvoice { .. } => true ,
@@ -1648,6 +1653,12 @@ impl OutboundPayments {
16481653 // next-hop is needlessly blaming us!
16491654 payment. get_mut ( ) . insert_previously_failed_scid ( scid) ;
16501655 }
1656+ if failed_within_blinded_path {
1657+ debug_assert ! ( short_channel_id. is_none( ) ) ;
1658+ if let Some ( bt) = & path. blinded_tail {
1659+ payment. get_mut ( ) . insert_previously_failed_blinded_path ( & bt) ;
1660+ } else { debug_assert ! ( false ) ; }
1661+ }
16511662
16521663 if payment_is_probe || !is_retryable_now || payment_failed_permanently {
16531664 let reason = if payment_failed_permanently {
0 commit comments