Skip to content

Commit 69bde76

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 3ad6bba commit 69bde76

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;
@@ -884,6 +886,11 @@ pub struct UserConfig {
884886
///
885887
/// Default value: `false`
886888
pub enable_dual_funded_channels: bool,
889+
/// [`BlindedMessagePath`]s to reach an always-online node that will serve [`StaticInvoice`]s on
890+
/// our behalf.
891+
///
892+
/// [`StaticInvoice`]: crate::offers::static_invoice::StaticInvoice
893+
pub paths_to_static_invoice_server: Vec<BlindedMessagePath>,
887894
}
888895

889896
impl Default for UserConfig {
@@ -898,6 +905,7 @@ impl Default for UserConfig {
898905
accept_intercept_htlcs: false,
899906
manually_handle_bolt12_invoices: false,
900907
enable_dual_funded_channels: false,
908+
paths_to_static_invoice_server: Vec::new(),
901909
}
902910
}
903911
}
@@ -918,6 +926,7 @@ impl Readable for UserConfig {
918926
accept_intercept_htlcs: Readable::read(reader)?,
919927
manually_handle_bolt12_invoices: Readable::read(reader)?,
920928
enable_dual_funded_channels: Readable::read(reader)?,
929+
paths_to_static_invoice_server: Vec::new(),
921930
})
922931
}
923932
}

lightning/src/util/ser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,7 @@ impl_for_vec!(crate::chain::channelmonitor::ChannelMonitorUpdate);
10801080
impl_for_vec!(crate::ln::channelmanager::MonitorUpdateCompletionAction);
10811081
impl_for_vec!(crate::ln::channelmanager::PaymentClaimDetails);
10821082
impl_for_vec!(crate::ln::msgs::SocketAddress);
1083+
impl_for_vec!(crate::blinded_path::message::BlindedMessagePath);
10831084
impl_for_vec!((A, B), A, B);
10841085
impl_for_vec!(SerialId);
10851086
impl_for_vec!(InteractiveTxInput);

0 commit comments

Comments
 (0)