use crate::ln::channelmanager::{ChannelDetails, EventCompletionAction, HTLCSource, PaymentId};
use crate::ln::onion_utils::{DecodedOnionFailure, HTLCFailReason};
use crate::offers::invoice::Bolt12Invoice;
-use crate::routing::router::{InFlightHtlcs, Path, PaymentParameters, Route, RouteParameters, Router};
+use crate::routing::router::{BlindedTail, InFlightHtlcs, Path, PaymentParameters, Route, RouteParameters, Router};
use crate::util::errors::APIError;
use crate::util::logger::Logger;
use crate::util::time::Time;
params.previously_failed_channels.push(scid);
}
}
+ pub fn insert_previously_failed_blinded_path(&mut self, blinded_tail: &BlindedTail) {
+ if let PendingOutboundPayment::Retryable { payment_params: Some(params), .. } = self {
+ params.insert_previously_failed_blinded_path(blinded_tail);
+ }
+ }
fn is_awaiting_invoice(&self) -> bool {
match self {
PendingOutboundPayment::AwaitingInvoice { .. } => true,
// next-hop is needlessly blaming us!
payment.get_mut().insert_previously_failed_scid(scid);
}
+ if failed_within_blinded_path {
+ debug_assert!(short_channel_id.is_none());
+ if let Some(bt) = &path.blinded_tail {
+ payment.get_mut().insert_previously_failed_blinded_path(&bt);
+ } else { debug_assert!(false); }
+ }
if payment_is_probe || !is_retryable_now || payment_failed_permanently {
let reason = if payment_failed_permanently {
pub fn with_max_channel_saturation_power_of_half(self, max_channel_saturation_power_of_half: u8) -> Self {
Self { max_channel_saturation_power_of_half, ..self }
}
+
+ pub(crate) fn insert_previously_failed_blinded_path(&mut self, failed_blinded_tail: &BlindedTail) {
+ let mut found_blinded_tail = false;
+ for (idx, (_, path)) in self.payee.blinded_route_hints().iter().enumerate() {
+ if failed_blinded_tail.hops == path.blinded_hops &&
+ failed_blinded_tail.blinding_point == path.blinding_point
+ {
+ self.previously_failed_blinded_path_idxs.push(idx as u64);
+ found_blinded_tail = true;
+ }
+ }
+ debug_assert!(found_blinded_tail);
+ }
}
/// The recipient of a payment, differing based on whether they've hidden their identity with route