Merge pull request #2845 from wpaulino/decode-htlc-onion-when-committed
[rust-lightning] / lightning / src / ln / onion_utils.rs
index 74de4a923577269bedce2a4dccb1821d307f76b6..249d094f61d6ad1e0eb4b9e5ef17ed076d18e9b3 100644 (file)
@@ -1072,6 +1072,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 {