X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fonion_message%2Fmessenger.rs;h=d9d6070ae058c7f0041901b6e0e0eae4f89e3a6b;hb=7eac8977467c06fb5746cb2ec0789ce1f37e02fa;hp=1a5673a35bb105043a853ccabdb8037a76528e99;hpb=a0d38d7eb9bba986447470a261978e7c73a49d76;p=rust-lightning diff --git a/lightning/src/onion_message/messenger.rs b/lightning/src/onion_message/messenger.rs index 1a5673a3..d9d6070a 100644 --- a/lightning/src/onion_message/messenger.rs +++ b/lightning/src/onion_message/messenger.rs @@ -15,7 +15,7 @@ use bitcoin::hashes::hmac::{Hmac, HmacEngine}; use bitcoin::hashes::sha256::Hash as Sha256; use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1, SecretKey}; -use crate::chain::keysinterface::{KeysInterface, KeysManager, Recipient}; +use crate::chain::keysinterface::{EntropySource, KeysInterface, KeysManager, NodeSigner, Recipient}; use crate::ln::features::{InitFeatures, NodeFeatures}; use crate::ln::msgs::{self, OnionMessageHandler}; use crate::ln::onion_utils; @@ -89,12 +89,12 @@ use crate::prelude::*; /// let message = OnionMessageContents::Custom(your_custom_message); /// onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path); /// -/// // Create a blinded route to yourself, for someone to send an onion message to. +/// // Create a blinded path to yourself, for someone to send an onion message to. /// # let your_node_id = hop_node_id1; /// let hops = [hop_node_id3, hop_node_id4, your_node_id]; /// let blinded_path = BlindedPath::new(&hops, &keys_manager, &secp_ctx).unwrap(); /// -/// // Send a custom onion message to a blinded route. +/// // Send a custom onion message to a blinded path. /// # let intermediate_hops = [hop_node_id1, hop_node_id2]; /// let reply_path = None; /// # let your_custom_message = YourCustomMessage {}; @@ -122,7 +122,7 @@ pub struct OnionMessenger pub enum Destination { /// We're sending this onion message to a node. Node(PublicKey), - /// We're sending this onion message to a blinded route. + /// We're sending this onion message to a blinded path. BlindedPath(BlindedPath), } @@ -158,9 +158,9 @@ pub enum SendError { /// /// [`KeysInterface`]: crate::chain::keysinterface::KeysInterface GetNodeIdFailed, - /// We attempted to send to a blinded route where we are the introduction node, and failed to - /// advance the blinded route to make the second hop the new introduction node. Either - /// [`KeysInterface::ecdh`] failed, we failed to tweak the current blinding point to get the + /// We attempted to send to a blinded path where we are the introduction node, and failed to + /// advance the blinded path to make the second hop the new introduction node. Either + /// [`NodeSigner::ecdh`] failed, we failed to tweak the current blinding point to get the /// new blinding point, or we were attempting to send to ourselves. BlindedPathAdvanceFailed, } @@ -216,8 +216,8 @@ impl OnionMessenger let OnionMessageContents::Custom(ref msg) = message; if msg.tlv_type() < 64 { return Err(SendError::InvalidMessage) } - // If we are sending straight to a blinded route and we are the introduction node, we need to - // advance the blinded route by 1 hop so the second hop is the new introduction node. + // If we are sending straight to a blinded path and we are the introduction node, we need to + // advance the blinded path by 1 hop so the second hop is the new introduction node. if intermediate_nodes.len() == 0 { if let Destination::BlindedPath(ref mut blinded_path) = destination { let our_node_id = self.keys_manager.get_node_id(Recipient::Node) @@ -346,7 +346,7 @@ impl OnionMessageHandler for OnionMessenger pk,