Skip to content

Commit 8dbf6db

Browse files
committed
Update references to "blinded route" to "blinded path"
Finishing the work from the previous two commits.
1 parent a0d38d7 commit 8dbf6db

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

lightning/src/onion_message/functional_tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ fn too_big_packet_error() {
168168

169169
#[test]
170170
fn we_are_intro_node() {
171-
// If we are sending straight to a blinded route and we are the introduction node, we need to
172-
// advance the blinded route by 1 hop so the second hop is the new introduction node.
171+
// If we are sending straight to a blinded path and we are the introduction node, we need to
172+
// advance the blinded path by 1 hop so the second hop is the new introduction node.
173173
let mut nodes = create_nodes(3);
174174
let test_msg = TestCustomMessage {};
175175

@@ -179,7 +179,7 @@ fn we_are_intro_node() {
179179
nodes[0].messenger.send_onion_message(&[], Destination::BlindedPath(blinded_path), OnionMessageContents::Custom(test_msg.clone()), None).unwrap();
180180
pass_along_path(&nodes, None);
181181

182-
// Try with a two-hop blinded route where we are the introduction node.
182+
// Try with a two-hop blinded path where we are the introduction node.
183183
let blinded_path = BlindedPath::new(&[nodes[0].get_node_pk(), nodes[1].get_node_pk()], &*nodes[1].keys_manager, &secp_ctx).unwrap();
184184
nodes[0].messenger.send_onion_message(&[], Destination::BlindedPath(blinded_path), OnionMessageContents::Custom(test_msg), None).unwrap();
185185
nodes.remove(2);
@@ -188,7 +188,7 @@ fn we_are_intro_node() {
188188

189189
#[test]
190190
fn invalid_blinded_path_error() {
191-
// Make sure we error as expected if a provided blinded route has 0 or 1 hops.
191+
// Make sure we error as expected if a provided blinded path has 0 or 1 hops.
192192
let nodes = create_nodes(3);
193193
let test_msg = TestCustomMessage {};
194194

lightning/src/onion_message/messenger.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ use crate::prelude::*;
8989
/// let message = OnionMessageContents::Custom(your_custom_message);
9090
/// onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path);
9191
///
92-
/// // Create a blinded route to yourself, for someone to send an onion message to.
92+
/// // Create a blinded path to yourself, for someone to send an onion message to.
9393
/// # let your_node_id = hop_node_id1;
9494
/// let hops = [hop_node_id3, hop_node_id4, your_node_id];
9595
/// let blinded_path = BlindedPath::new(&hops, &keys_manager, &secp_ctx).unwrap();
9696
///
97-
/// // Send a custom onion message to a blinded route.
97+
/// // Send a custom onion message to a blinded path.
9898
/// # let intermediate_hops = [hop_node_id1, hop_node_id2];
9999
/// let reply_path = None;
100100
/// # let your_custom_message = YourCustomMessage {};
@@ -122,7 +122,7 @@ pub struct OnionMessenger<K: Deref, L: Deref, CMH: Deref>
122122
pub enum Destination {
123123
/// We're sending this onion message to a node.
124124
Node(PublicKey),
125-
/// We're sending this onion message to a blinded route.
125+
/// We're sending this onion message to a blinded path.
126126
BlindedPath(BlindedPath),
127127
}
128128

@@ -158,8 +158,8 @@ pub enum SendError {
158158
///
159159
/// [`KeysInterface`]: crate::chain::keysinterface::KeysInterface
160160
GetNodeIdFailed,
161-
/// We attempted to send to a blinded route where we are the introduction node, and failed to
162-
/// advance the blinded route to make the second hop the new introduction node. Either
161+
/// We attempted to send to a blinded path where we are the introduction node, and failed to
162+
/// advance the blinded path to make the second hop the new introduction node. Either
163163
/// [`KeysInterface::ecdh`] failed, we failed to tweak the current blinding point to get the
164164
/// new blinding point, or we were attempting to send to ourselves.
165165
BlindedPathAdvanceFailed,
@@ -216,8 +216,8 @@ impl<K: Deref, L: Deref, CMH: Deref> OnionMessenger<K, L, CMH>
216216
let OnionMessageContents::Custom(ref msg) = message;
217217
if msg.tlv_type() < 64 { return Err(SendError::InvalidMessage) }
218218

219-
// If we are sending straight to a blinded route and we are the introduction node, we need to
220-
// advance the blinded route by 1 hop so the second hop is the new introduction node.
219+
// If we are sending straight to a blinded path and we are the introduction node, we need to
220+
// advance the blinded path by 1 hop so the second hop is the new introduction node.
221221
if intermediate_nodes.len() == 0 {
222222
if let Destination::BlindedPath(ref mut blinded_path) = destination {
223223
let our_node_id = self.keys_manager.get_node_id(Recipient::Node)
@@ -346,7 +346,7 @@ impl<K: Deref, L: Deref, CMH: Deref> OnionMessageHandler for OnionMessenger<K, L
346346
// TODO: we need to check whether `next_node_id` is our node, in which case this is a dummy
347347
// blinded hop and this onion message is destined for us. In this situation, we should keep
348348
// unwrapping the onion layers to get to the final payload. Since we don't have the option
349-
// of creating blinded routes with dummy hops currently, we should be ok to not handle this
349+
// of creating blinded paths with dummy hops currently, we should be ok to not handle this
350350
// for now.
351351
let new_pubkey = match onion_utils::next_hop_packet_pubkey(&self.secp_ctx, msg.onion_routing_packet.public_key, &onion_decode_ss) {
352352
Ok(pk) => pk,

lightning/src/onion_message/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
//! Onion messages are multi-purpose messages sent between peers over the lightning network. In the
1313
//! near future, they will be used to communicate invoices for [offers], unlocking use cases such as
1414
//! static invoices, refunds and proof of payer. Further, you will be able to accept payments
15-
//! without revealing your node id through the use of [blinded routes].
15+
//! without revealing your node id through the use of [blinded paths].
1616
//!
1717
//! LDK sends and receives onion messages via the [`OnionMessenger`]. See its documentation for more
1818
//! information on its usage.
1919
//!
2020
//! [offers]: <https://github.com/lightning/bolts/pull/798>
21-
//! [blinded routes]: crate::onion_message::BlindedPath
21+
//! [blinded paths]: crate::onion_message::BlindedPath
2222
2323
mod blinded_path;
2424
mod messenger;

lightning/src/onion_message/packet.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub trait CustomOnionMessageContents: Writeable {
141141

142142
/// Forward control TLVs in their blinded and unblinded form.
143143
pub(super) enum ForwardControlTlvs {
144-
/// If we're sending to a blinded route, the node that constructed the blinded route has provided
144+
/// If we're sending to a blinded path, the node that constructed the blinded path has provided
145145
/// this hop's control TLVs, already encrypted into bytes.
146146
Blinded(Vec<u8>),
147147
/// If we're constructing an onion message hop through an intermediate unblinded node, we'll need

0 commit comments

Comments
 (0)