You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When constructing onion messages to send initially (opposed to replying
to one from a handler), the user must construct an OnionMessagePath first
before calling OnionMessener::send_onion_message. Additionally, having a
reference to OnionMessener isn't always desirable. For instance, in an
upcoming commit, ChannelManager will implement OffersMessageHandler,
which OnionMessenger needs a reference to. If ChannelManager had a
reference to OnionMessenger, too, there would be a dependency cycle.
Instead, modify OffersMessageHandler and CustomOnionMessageHandler's
interfaces to include a method for releasing pending onion messages.
That way, ChannelManager may, for instance, construct and enqueue an
InvoiceRequest for sending without needing a reference to
OnionMessenger.
Additionally, OnionMessenger has responsibility for path finding just as
it does when replying to messages from a handler. It performs this when
extracting messages from the handlers before returning the next message
to send to a peer.
Copy file name to clipboardExpand all lines: fuzz/src/onion_message.rs
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ use lightning::offers::invoice_request::UnsignedInvoiceRequest;
14
14
use lightning::util::test_channel_signer::TestChannelSigner;
15
15
use lightning::util::logger::Logger;
16
16
use lightning::util::ser::{Readable,Writeable,Writer};
17
-
use lightning::onion_message::{CustomOnionMessageHandler,Destination,MessageRouter,OffersMessage,OffersMessageHandler,OnionMessageContents,OnionMessagePath,OnionMessenger};
17
+
use lightning::onion_message::{CustomOnionMessageHandler,Destination,MessageRouter,OffersMessage,OffersMessageHandler,OnionMessageContents,OnionMessagePath,OnionMessenger,PendingOnionMessage};
18
18
19
19
usecrate::utils::test_logger;
20
20
@@ -108,6 +108,9 @@ impl CustomOnionMessageHandler for TestCustomMessageHandler {
0 commit comments