Skip to content

Commit a6cd661

Browse files
committed
Update OnionMessenger docs for Offers
1 parent 0357caf commit a6cd661

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

lightning/src/onion_message/messenger.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,21 @@ use crate::io;
3535
use crate::sync::{Arc, Mutex};
3636
use crate::prelude::*;
3737

38-
/// A sender, receiver and forwarder of onion messages. In upcoming releases, this object will be
39-
/// used to retrieve invoices and fulfill invoice requests from [offers]. Currently, only sending
40-
/// and receiving custom onion messages is supported.
38+
/// A sender, receiver and forwarder of [`OnionMessage`]s.
39+
///
40+
/// # Handling Messages
41+
///
42+
/// `OnionMessenger` implements [`OnionMessageHandler`], making it responsible for either forwarding
43+
/// messages to peers or delegating to the appropriate handler for the message type. Currently, the
44+
/// available handlers are:
45+
/// * [`OffersMessageHandler`], for responding to [`InvoiceRequest`]s and paying [`Bolt12Invoice`]s
46+
/// * [`CustomOnionMessageHandler`], for handling user-defined message types
47+
///
48+
/// # Sending Messages
49+
///
50+
/// [`OnionMessage`]s are sent initially using [`OnionMessenger::send_onion_message`]. When handling
51+
/// a message, the matched handler may return a response message which `OnionMessenger` will send
52+
/// on its behalf.
4153
///
4254
/// # Example
4355
///
@@ -121,8 +133,9 @@ use crate::prelude::*;
121133
/// onion_messenger.send_onion_message(path, message, reply_path);
122134
/// ```
123135
///
124-
/// [offers]: <https://github.com/lightning/bolts/pull/798>
125-
/// [`OnionMessenger`]: crate::onion_message::OnionMessenger
136+
/// [`OnionMessage`]: crate::ln::msgs::OnionMessage
137+
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
138+
/// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
126139
pub struct OnionMessenger<ES: Deref, NS: Deref, L: Deref, MR: Deref, OMH: Deref, CMH: Deref>
127140
where
128141
ES::Target: EntropySource,

0 commit comments

Comments
 (0)