Skip to content

Commit 863eb54

Browse files
Add accessor methods for inner blinded path fields.
1 parent f9b52a9 commit 863eb54

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
@@ -118,6 +118,23 @@ impl BlindedMessagePath {
118118
) -> Option<&'a NodeId> {
119119
self.0.public_introduction_node_id(network_graph)
120120
}
121+
122+
/// The [`IntroductionNode`] of the blinded path.
123+
pub fn introduction_node(&self) -> &IntroductionNode {
124+
&self.0.introduction_node
125+
}
126+
127+
/// Used by the [`IntroductionNode`] to decrypt its [`encrypted_payload`] to forward the message.
128+
///
129+
/// [`encrypted_payload`]: BlindedHop::encrypted_payload
130+
pub fn blinding_point(&self) -> PublicKey {
131+
self.0.blinding_point
132+
}
133+
134+
/// The [`BlindedHop`]s within the blinded path.
135+
pub fn blinded_hops(&self) -> &Vec<BlindedHop> {
136+
&self.0.blinded_hops
137+
}
121138
}
122139

123140
/// 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) -> &Vec<BlindedHop> {
121+
&self.0.blinded_hops
122+
}
106123
}
107124

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

0 commit comments

Comments
 (0)