@@ -19,7 +19,7 @@ use crate::ln::{PaymentHash, PaymentPreimage, PaymentSecret};
19
19
use crate :: ln:: channelmanager:: { ChannelDetails , EventCompletionAction , HTLCSource , PaymentId } ;
20
20
use crate :: ln:: onion_utils:: { DecodedOnionFailure , HTLCFailReason } ;
21
21
use 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 } ;
23
23
use crate :: util:: errors:: APIError ;
24
24
use crate :: util:: logger:: Logger ;
25
25
use crate :: util:: time:: Time ;
@@ -129,6 +129,11 @@ impl PendingOutboundPayment {
129
129
params. previously_failed_channels . push ( scid) ;
130
130
}
131
131
}
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
+ }
132
137
fn is_awaiting_invoice ( & self ) -> bool {
133
138
match self {
134
139
PendingOutboundPayment :: AwaitingInvoice { .. } => true ,
@@ -1648,6 +1653,12 @@ impl OutboundPayments {
1648
1653
// next-hop is needlessly blaming us!
1649
1654
payment. get_mut ( ) . insert_previously_failed_scid ( scid) ;
1650
1655
}
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
+ }
1651
1662
1652
1663
if payment_is_probe || !is_retryable_now || payment_failed_permanently {
1653
1664
let reason = if payment_failed_permanently {
0 commit comments