From: Valentine Wallace Date: Tue, 13 Aug 2024 18:28:02 +0000 (-0400) Subject: Add accessor methods for inner blinded path fields. X-Git-Tag: v0.0.124-beta~10^2~6 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=c563c150f0c7adc59ca3f783cde5cb0e8e88d40d;p=rust-lightning Add accessor methods for inner blinded path fields. --- diff --git a/lightning/src/blinded_path/message.rs b/lightning/src/blinded_path/message.rs index b2199d514..d5c44fbd5 100644 --- a/lightning/src/blinded_path/message.rs +++ b/lightning/src/blinded_path/message.rs @@ -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. diff --git a/lightning/src/blinded_path/payment.rs b/lightning/src/blinded_path/payment.rs index 0d40ecf61..ad8e9b5bd 100644 --- a/lightning/src/blinded_path/payment.rs +++ b/lightning/src/blinded_path/payment.rs @@ -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.