Add accessor methods for inner blinded path fields.

This commit is contained in:
Valentine Wallace 2024-08-13 14:28:02 -04:00
parent 10449b96de
commit c563c150f0
No known key found for this signature in database
GPG key ID: FD3E106A2CE099B4
2 changed files with 34 additions and 0 deletions

View 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.

View 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.