Skip to content

Commit b52f1b4

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 9e0f2da commit b52f1b4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-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;
@@ -878,6 +880,11 @@ pub struct UserConfig {
878880
/// [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
879881
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
880882
pub manually_handle_bolt12_invoices: bool,
883+
/// [`BlindedMessagePath`]s to reach an always-online node that will serve [`StaticInvoice`]s on
884+
/// our behalf.
885+
///
886+
/// [`StaticInvoice`]: crate::offers::static_invoice::StaticInvoice
887+
pub paths_to_static_invoice_server: Vec<BlindedMessagePath>,
881888
}
882889

883890
impl Default for UserConfig {
@@ -891,6 +898,7 @@ impl Default for UserConfig {
891898
manually_accept_inbound_channels: false,
892899
accept_intercept_htlcs: false,
893900
manually_handle_bolt12_invoices: false,
901+
paths_to_static_invoice_server: Vec::new(),
894902
}
895903
}
896904
}
@@ -910,6 +918,7 @@ impl Readable for UserConfig {
910918
manually_accept_inbound_channels: Readable::read(reader)?,
911919
accept_intercept_htlcs: Readable::read(reader)?,
912920
manually_handle_bolt12_invoices: Readable::read(reader)?,
921+
paths_to_static_invoice_server: Vec::new(),
913922
})
914923
}
915924
}

0 commit comments

Comments
 (0)