+/// Information used to forward or fail this HTLC that is being forwarded within a blinded path.
+#[derive(Clone, Copy, Hash, PartialEq, Eq)]
+pub struct BlindedForward {
+ /// The `blinding_point` that was set in the inbound [`msgs::UpdateAddHTLC`], or in the inbound
+ /// onion payload if we're the introduction node. Useful for calculating the next hop's
+ /// [`msgs::UpdateAddHTLC::blinding_point`].
+ pub inbound_blinding_point: PublicKey,
+ // Another field will be added here when we support forwarding as a non-intro node.
+}
+
+impl PendingHTLCRouting {
+ // Used to override the onion failure code and data if the HTLC is blinded.
+ fn blinded_failure(&self) -> Option<BlindedFailure> {
+ // TODO: needs update when we support receiving to multi-hop blinded paths
+ if let Self::Forward { blinded: Some(_), .. } = self {
+ Some(BlindedFailure::FromIntroductionNode)
+ } else {
+ None
+ }
+ }
+}
+