Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub mod bump_transaction;

pub use bump_transaction::BumpTransactionEvent;

use crate::blinded_path::message::OffersContext;
use crate::blinded_path::message::{BlindedMessagePath, OffersContext};
use crate::blinded_path::payment::{
Bolt12OfferContext, Bolt12RefundContext, PaymentContext, PaymentContextRef,
};
Expand All @@ -28,6 +28,7 @@ use crate::ln::channelmanager::{InterceptId, PaymentId, RecipientOnionFields};
use crate::ln::types::ChannelId;
use crate::ln::{msgs, LocalHTLCFailureReason};
use crate::offers::invoice::Bolt12Invoice;
use crate::offers::invoice_request::InvoiceRequest;
use crate::offers::static_invoice::StaticInvoice;
use crate::onion_message::messenger::Responder;
use crate::routing::gossip::NetworkUpdate;
Expand Down Expand Up @@ -1654,6 +1655,15 @@ pub enum Event {
/// The invoice that should be persisted and later provided to payers when handling a future
/// [`Event::StaticInvoiceRequested`].
invoice: StaticInvoice,
/// The path to where invoice requests will be forwarded. As a static invoice
/// server, if we receive an invoice request on behalf of an async recipient, a static
/// invoice will be provided to the payer. However, we'll also forward the invoice
/// request to this path to the async recipient in case it is online so that the
/// recipient can provide a new invoice. This path should be persisted and later
/// provided to [`ChannelManager::send_response_static_invoice_request`].
///
/// [`ChannelManager::send_response_static_invoice_request`]: crate::ln::channelmanager::ChannelManager::send_response_static_invoice_request
invoice_request_path: BlindedMessagePath,
/// Useful for the recipient to replace a specific invoice stored by us as the static invoice
/// server.
///
Expand Down Expand Up @@ -1686,12 +1696,14 @@ pub enum Event {
///
/// If we previously persisted a [`StaticInvoice`] from an [`Event::PersistStaticInvoice`] that
/// matches the below `recipient_id` and `invoice_slot`, that invoice should be retrieved now
/// and forwarded to the payer via [`ChannelManager::send_static_invoice`].
/// and forwarded to the payer via [`ChannelManager::send_response_static_invoice_request`].
/// The invoice request path previously persisted from [`Event::PersistStaticInvoice`] should
/// also be provided in [`ChannelManager::send_response_static_invoice_request`].
///
/// [`ChannelManager::blinded_paths_for_async_recipient`]: crate::ln::channelmanager::ChannelManager::blinded_paths_for_async_recipient
/// [`ChannelManager::set_paths_to_static_invoice_server`]: crate::ln::channelmanager::ChannelManager::set_paths_to_static_invoice_server
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
/// [`ChannelManager::send_static_invoice`]: crate::ln::channelmanager::ChannelManager::send_static_invoice
/// [`ChannelManager::send_response_static_invoice_request`]: crate::ln::channelmanager::ChannelManager::send_response_static_invoice_request
StaticInvoiceRequested {
/// An identifier for the recipient previously surfaced in
/// [`Event::PersistStaticInvoice::recipient_id`]. Useful when paired with the `invoice_slot` to
Expand All @@ -1702,10 +1714,15 @@ pub enum Event {
/// retrieve the [`StaticInvoice`] requested by the payer.
invoice_slot: u16,
/// The path over which the [`StaticInvoice`] will be sent to the payer, which should be
/// provided to [`ChannelManager::send_static_invoice`] along with the invoice.
/// provided to [`ChannelManager::send_response_static_invoice_request`] along with the invoice.
///
/// [`ChannelManager::send_static_invoice`]: crate::ln::channelmanager::ChannelManager::send_static_invoice
/// [`ChannelManager::send_response_static_invoice_request`]: crate::ln::channelmanager::ChannelManager::send_response_static_invoice_request
reply_path: Responder,
/// The invoice request that will be forwarded to the async recipient to give it a
/// chance to provide an invoice in case it is online. It should be provided to [`ChannelManager::send_response_static_invoice_request`].
///
/// [`ChannelManager::send_response_static_invoice_request`]: crate::ln::channelmanager::ChannelManager::send_response_static_invoice_request
invoice_request: InvoiceRequest,
},
/// Indicates that a channel funding transaction constructed interactively is ready to be
/// signed. This event will only be triggered if at least one input was contributed.
Expand Down
Loading
Loading