Skip to content

Commit ffbe363

Browse files
committed
f - rearrange docs
1 parent f228988 commit ffbe363

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8563,14 +8563,8 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
85638563
///
85648564
/// Uses [`MessageRouter`] to construct a [`BlindedPath`] for the offer based on the given
85658565
/// `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
8566-
/// privacy implications.
8567-
///
8568-
/// The [`Router`] used to parameterized [`ChannelManager`] may also affect privacy since it
8569-
/// implements [`MessageRouter`]. If parameterized with [`DefaultRouter`], it will delegate to
8570-
/// [`DefaultMessageRouter`]. In that case, it may return a one-hop [`BlindedPath`] with
8571-
/// [`ChannelManager::get_our_node_id`] as the introduction node if no other path can be found
8572-
/// *and* the node is announced. Otherwise, there is no way to find a path to the introduction
8573-
/// in order to send the [`InvoiceRequest`].
8566+
/// privacy implications as well as those of the parameterized [`Router`], which implements
8567+
/// [`MessageRouter`].
85748568
///
85758569
/// Also, uses a derived signing pubkey in the offer for recipient privacy.
85768570
///
@@ -8584,7 +8578,6 @@ macro_rules! create_offer_builder { ($self: ident, $builder: ty) => {
85848578
/// Errors if the parameterized [`Router`] is unable to create a blinded path for the offer.
85858579
///
85868580
/// [`Offer`]: crate::offers::offer::Offer
8587-
/// [`DefaultMessageRouter`]: crate::onion_message::messenger::DefaultMessageRouter
85888581
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
85898582
pub fn create_offer_builder(
85908583
&$self, absolute_expiry: Option<Duration>
@@ -8636,14 +8629,8 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
86368629
///
86378630
/// Uses [`MessageRouter`] to construct a [`BlindedPath`] for the refund based on the given
86388631
/// `absolute_expiry` according to [`MAX_SHORT_LIVED_RELATIVE_EXPIRY`]. See those docs for
8639-
/// privacy implications.
8640-
///
8641-
/// The [`Router`] used to parameterized [`ChannelManager`] may also affect privacy since it
8642-
/// implements [`MessageRouter`]. If parameterized with [`DefaultRouter`], it will delegate to
8643-
/// [`DefaultMessageRouter`]. In that case, it may return a one-hop [`BlindedPath`] with
8644-
/// [`ChannelManager::get_our_node_id`] as the introduction node if no other path can be found
8645-
/// *and* the node is announced. Otherwise, there is no way to find a path to the introduction
8646-
/// in order to send the [`Bolt12Invoice`].
8632+
/// privacy implications as well as those of the parameterized [`Router`], which implements
8633+
/// [`MessageRouter`].
86478634
///
86488635
/// Also, uses a derived payer id in the refund for payer privacy.
86498636
///
@@ -8660,7 +8647,6 @@ macro_rules! create_refund_builder { ($self: ident, $builder: ty) => {
86608647
/// - the parameterized [`Router`] is unable to create a blinded path for the refund.
86618648
///
86628649
/// [`Refund`]: crate::offers::refund::Refund
8663-
/// [`DefaultMessageRouter`]: crate::onion_message::messenger::DefaultMessageRouter
86648650
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
86658651
/// [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths
86668652
/// [Avoiding Duplicate Payments]: #avoiding-duplicate-payments
@@ -8743,10 +8729,9 @@ where
87438729
///
87448730
/// # Privacy
87458731
///
8746-
/// Uses a one-hop [`BlindedPath`] for the reply path with [`ChannelManager::get_our_node_id`]
8747-
/// as the introduction node and a derived payer id for payer privacy. As such, currently, the
8748-
/// node must be announced. Otherwise, there is no way to find a path to the introduction node
8749-
/// in order to send the [`Bolt12Invoice`].
8732+
/// For payer privacy, uses a derived payer id and uses [`MessageRouter::create_blinded_paths`]
8733+
/// to construct a [`BlindedPath`] for the reply path. For further privacy implications, see the
8734+
/// docs of the parameterized [`Router`], which implements [`MessageRouter`].
87508735
///
87518736
/// # Limitations
87528737
///

lightning/src/onion_message/messenger.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,13 @@ pub trait MessageRouter {
371371
}
372372

373373
/// A [`MessageRouter`] that can only route to a directly connected [`Destination`].
374+
///
375+
/// # Privacy
376+
///
377+
/// Creating [`BlindedPath`]s may affect privacy since, if a suitable path cannot be found, it will
378+
/// create a one-hop path using the recipient as the introduction node if it is a announced node.
379+
/// Otherwise, there is no way to find a path to the introduction node in order to send a message,
380+
/// and thus an `Err` is returned.
374381
pub struct DefaultMessageRouter<G: Deref<Target=NetworkGraph<L>>, L: Deref, ES: Deref>
375382
where
376383
L::Target: Logger,

lightning/src/routing/router.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ use core::{cmp, fmt};
3535
use core::ops::Deref;
3636

3737
/// A [`Router`] implemented using [`find_route`].
38+
///
39+
/// # Privacy
40+
///
41+
/// Implements [`MessageRouter`] by delegating to [`DefaultMessageRouter`]. See those docs for
42+
/// privacy implications.
3843
pub struct DefaultRouter<G: Deref<Target = NetworkGraph<L>> + Clone, L: Deref, ES: Deref, S: Deref, SP: Sized, Sc: ScoreLookUp<ScoreParams = SP>> where
3944
L::Target: Logger,
4045
S::Target: for <'a> LockableScore<'a, ScoreLookUp = Sc>,

0 commit comments

Comments
 (0)