Add is_intro_node_blinded_forward helper for onion_utils::Hop
[rust-lightning] / lightning / src / ln / onion_utils.rs
index 53ef0729aa171ba56ff33ba73a55cb4ed922df83..4bb77bb4b51f19774a36076aa5287b738ede252d 100644 (file)
@@ -1054,6 +1054,21 @@ pub(crate) enum Hop {
        },
 }
 
+impl Hop {
+       pub(crate) fn is_intro_node_blinded_forward(&self) -> bool {
+               match self {
+                       Self::Forward {
+                               next_hop_data:
+                                       msgs::InboundOnionPayload::BlindedForward {
+                                               intro_node_blinding_point: Some(_), ..
+                                       },
+                               ..
+                       } => true,
+                       _ => false,
+               }
+       }
+}
+
 /// Error returned when we fail to decode the onion packet.
 #[derive(Debug)]
 pub(crate) enum OnionDecodeErr {