Skip to content

Commit c563c15

Browse files
Add accessor methods for inner blinded path fields.
1 parent 10449b9 commit c563c15

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

lightning/src/blinded_path/message.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,23 @@ impl BlindedMessagePath {
120120
) -> Option<&'a NodeId> {
121121
self.0.public_introduction_node_id(network_graph)
122122
}
123+
124+
/// The [`IntroductionNode`] of the blinded path.
125+
pub fn introduction_node(&self) -> &IntroductionNode {
126+
&self.0.introduction_node
127+
}
128+
129+
/// Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the message.
130+
///
131+
/// [`encrypted_payload`]: BlindedHop::encrypted_payload
132+
pub fn blinding_point(&self) -> PublicKey {
133+
self.0.blinding_point
134+
}
135+
136+
/// The [`BlindedHop`]s within the blinded path.
137+
pub fn blinded_hops(&self) -> &[BlindedHop] {
138+
&self.0.blinded_hops
139+
}
123140
}
124141

125142
/// An intermediate node, and possibly a short channel id leading to the next node.

lightning/src/blinded_path/payment.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,23 @@ impl BlindedPaymentPath {
103103
) -> Option<&'a NodeId> {
104104
self.0.public_introduction_node_id(network_graph)
105105
}
106+
107+
/// The [`IntroductionNode`] of the blinded path.
108+
pub fn introduction_node(&self) -> &IntroductionNode {
109+
&self.0.introduction_node
110+
}
111+
112+
/// Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the payment.
113+
///
114+
/// [`encrypted_payload`]: BlindedHop::encrypted_payload
115+
pub fn blinding_point(&self) -> PublicKey {
116+
self.0.blinding_point
117+
}
118+
119+
/// The [`BlindedHop`]s within the blinded path.
120+
pub fn blinded_hops(&self) -> &[BlindedHop] {
121+
&self.0.blinded_hops
122+
}
106123
}
107124

108125
/// An intermediate node, its outbound channel, and relay parameters.

0 commit comments

Comments
 (0)