Add variant for non-intro-nodes to BlindedFailure enum
[rust-lightning] / lightning / src / ln / channelmanager.rs
index 7c6ee1e429c1d1a325759d22c0a73207fa50d730..f1dae2747b49919b44de69022c1a08fa109126cf 100644 (file)
@@ -292,7 +292,7 @@ pub(super) enum HTLCForwardInfo {
 #[derive(Clone, Debug, Hash, PartialEq, Eq)]
 enum BlindedFailure {
        FromIntroductionNode,
-       // Another variant will be added here for non-intro nodes.
+       FromBlindedNode,
 }
 
 /// Tracks the inbound corresponding to an outbound HTLC
@@ -4248,7 +4248,7 @@ where
                                                                                                let phantom_shared_secret = self.node_signer.ecdh(Recipient::PhantomNode, &onion_packet.public_key.unwrap(), None).unwrap().secret_bytes();
                                                                                                let next_hop = match onion_utils::decode_next_payment_hop(
                                                                                                        phantom_shared_secret, &onion_packet.hop_data, onion_packet.hmac,
-                                                                                                       payment_hash, &self.node_signer
+                                                                                                       payment_hash, None, &self.node_signer
                                                                                                ) {
                                                                                                        Ok(res) => res,
                                                                                                        Err(onion_utils::OnionDecodeErr::Malformed { err_msg, err_code }) => {
@@ -5243,6 +5243,7 @@ where
                                                        incoming_packet_shared_secret, phantom_shared_secret
                                                )
                                        },
+                                       Some(BlindedFailure::FromBlindedNode) => todo!(),
                                        None => {
                                                onion_error.get_encrypted_failure_packet(incoming_packet_shared_secret, phantom_shared_secret)
                                        }
@@ -9467,7 +9468,8 @@ impl_writeable_tlv_based_enum!(PendingHTLCStatus, ;
 );
 
 impl_writeable_tlv_based_enum!(BlindedFailure,
-       (0, FromIntroductionNode) => {}, ;
+       (0, FromIntroductionNode) => {},
+       (2, FromBlindedNode) => {}, ;
 );
 
 impl_writeable_tlv_based!(HTLCPreviousHopData, {