@@ -17,9 +17,9 @@ use crate::sign::{EntropySource, NodeSigner, Recipient};
1717use crate :: events:: { self , PaymentFailureReason } ;
1818use crate :: ln:: { PaymentHash , PaymentPreimage , PaymentSecret } ;
1919use crate :: ln:: channelmanager:: { ChannelDetails , EventCompletionAction , HTLCSource , PaymentId } ;
20- use crate :: ln:: onion_utils:: { DecodedOnionFailure , HTLCFailReason } ;
20+ use crate :: ln:: onion_utils:: { DecodedOnionFailure , HTLCFailReason , INVALID_ONION_BLINDING } ;
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 onion_error_code == Some ( INVALID_ONION_BLINDING ) {
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+ }
1661+ }
16511662
16521663 if payment_is_probe || !is_retryable_now || payment_failed_permanently {
16531664 let reason = if payment_failed_permanently {
0 commit comments