+ /// Indicates that a peer connection with a node is needed in order to send an [`OnionMessage`].
+ ///
+ /// Typically, this happens when a [`MessageRouter`] is unable to find a complete path to a
+ /// [`Destination`]. Once a connection is established, any messages buffered by an
+ /// [`OnionMessageHandler`] may be sent.
+ ///
+ /// This event will not be generated for onion message forwards; only for sends including
+ /// replies. Handlers should connect to the node otherwise any buffered messages may be lost.
+ ///
+ /// [`OnionMessage`]: msgs::OnionMessage
+ /// [`MessageRouter`]: crate::onion_message::MessageRouter
+ /// [`Destination`]: crate::onion_message::Destination
+ /// [`OnionMessageHandler`]: crate::ln::msgs::OnionMessageHandler
+ ConnectionNeeded {
+ /// The node id for the node needing a connection.
+ node_id: PublicKey,
+ /// Sockets for connecting to the node.
+ addresses: Vec<msgs::SocketAddress>,
+ },
+ /// Indicates a request for an invoice failed to yield a response in a reasonable amount of time
+ /// or was explicitly abandoned by [`ChannelManager::abandon_payment`]. This may be for an
+ /// [`InvoiceRequest`] sent for an [`Offer`] or for a [`Refund`] that hasn't been redeemed.
+ ///
+ /// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ /// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
+ /// [`Offer`]: crate::offers::offer::Offer
+ /// [`Refund`]: crate::offers::refund::Refund
+ InvoiceRequestFailed {
+ /// The `payment_id` to have been associated with payment for the requested invoice.
+ payment_id: PaymentId,
+ },