]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Add accessor methods for inner blinded path fields.
authorValentine Wallace <vwallace@protonmail.com>
Tue, 13 Aug 2024 18:28:02 +0000 (14:28 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Thu, 15 Aug 2024 17:04:04 +0000 (13:04 -0400)
lightning/src/blinded_path/message.rs
lightning/src/blinded_path/payment.rs

index b2199d514876b431ddac688218b8dce7715f641b..d5c44fbd55e4da518e58f317871a32aa3c4e0eb6 100644 (file)
@@ -120,6 +120,23 @@ impl BlindedMessagePath {
        ) -> Option<&'a NodeId> {
                self.0.public_introduction_node_id(network_graph)
        }
+
+       /// The [`IntroductionNode`] of the blinded path.
+       pub fn introduction_node(&self) -> &IntroductionNode {
+               &self.0.introduction_node
+       }
+
+       /// Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the message.
+       ///
+       /// [`encrypted_payload`]: BlindedHop::encrypted_payload
+       pub fn blinding_point(&self) -> PublicKey {
+               self.0.blinding_point
+       }
+
+       /// The [`BlindedHop`]s within the blinded path.
+       pub fn blinded_hops(&self) -> &[BlindedHop] {
+               &self.0.blinded_hops
+       }
 }
 
 /// An intermediate node, and possibly a short channel id leading to the next node.
index 0d40ecf610e0761c6665d2f16f262cbee0673dac..ad8e9b5bdd7eae33c905f2c69b24c0e8c99ac7e8 100644 (file)
@@ -103,6 +103,23 @@ impl BlindedPaymentPath {
        ) -> Option<&'a NodeId> {
                self.0.public_introduction_node_id(network_graph)
        }
+
+       /// The [`IntroductionNode`] of the blinded path.
+       pub fn introduction_node(&self) -> &IntroductionNode {
+               &self.0.introduction_node
+       }
+
+       /// Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the payment.
+       ///
+       /// [`encrypted_payload`]: BlindedHop::encrypted_payload
+       pub fn blinding_point(&self) -> PublicKey {
+               self.0.blinding_point
+       }
+
+       /// The [`BlindedHop`]s within the blinded path.
+       pub fn blinded_hops(&self) -> &[BlindedHop] {
+               &self.0.blinded_hops
+       }
 }
 
 /// An intermediate node, its outbound channel, and relay parameters.