Skip to content

Commit ea87d80

Browse files
Add config for paths to a static invoice server
As part of being an async recipient, we need to support interactively building an offer and static invoice with an always-online node that will serve static invoices on our behalf. Add a config field containing blinded message paths that async recipients can use to request blinded paths that will be included in their offer. Payers will forward invoice requests over the paths returned by the server, and receive a static invoice in response if the recipient is offline.
1 parent 7bd3980 commit ea87d80

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lightning/src/util/config.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
//! Various user-configurable channel limits and settings which ChannelManager
1111
//! applies for you.
1212
13+
use crate::blinded_path::message::BlindedMessagePath;
1314
use crate::ln::channel::MAX_FUNDING_SATOSHIS_NO_WUMBO;
1415
use crate::ln::channelmanager::{BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT};
16+
use crate::prelude::*;
1517

1618
#[cfg(fuzzing)]
1719
use crate::util::ser::Readable;
@@ -875,6 +877,11 @@ pub struct UserConfig {
875877
/// [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
876878
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
877879
pub manually_handle_bolt12_invoices: bool,
880+
/// [`BlindedMessagePath`]s to reach an always-online node that will serve [`StaticInvoice`]s on
881+
/// our behalf.
882+
///
883+
/// [`StaticInvoice`]: crate::offers::static_invoice::StaticInvoice
884+
pub paths_to_static_invoice_server: Vec<BlindedMessagePath>,
878885
}
879886

880887
impl Default for UserConfig {
@@ -888,6 +895,7 @@ impl Default for UserConfig {
888895
manually_accept_inbound_channels: false,
889896
accept_intercept_htlcs: false,
890897
manually_handle_bolt12_invoices: false,
898+
paths_to_static_invoice_server: Vec::new(),
891899
}
892900
}
893901
}
@@ -907,6 +915,7 @@ impl Readable for UserConfig {
907915
manually_accept_inbound_channels: Readable::read(reader)?,
908916
accept_intercept_htlcs: Readable::read(reader)?,
909917
manually_handle_bolt12_invoices: Readable::read(reader)?,
918+
paths_to_static_invoice_server: Vec::new(),
910919
})
911920
}
912921
}

lightning/src/util/ser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,7 @@ impl_for_vec!(crate::chain::channelmonitor::ChannelMonitorUpdate);
10781078
impl_for_vec!(crate::ln::channelmanager::MonitorUpdateCompletionAction);
10791079
impl_for_vec!(crate::ln::channelmanager::PaymentClaimDetails);
10801080
impl_for_vec!(crate::ln::msgs::SocketAddress);
1081+
impl_for_vec!(crate::blinded_path::message::BlindedMessagePath);
10811082
impl_for_vec!((A, B), A, B);
10821083
impl_writeable_for_vec!(&crate::routing::router::BlindedTail);
10831084
impl_readable_for_vec!(crate::routing::router::BlindedTail);

0 commit comments

Comments
 (0)