Add UserConfig::manually_handle_bolt12_invoices
[rust-lightning] / lightning / src / util / config.rs
index 2473eea26274500800a4e5ea11c9ce9e6530fde4..3520e219c453b88c60393413385d157f6b87a13c 100644 (file)
@@ -847,6 +847,16 @@ pub struct UserConfig {
        ///
        /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
        pub accept_mpp_keysend: bool,
+       /// If this is set to true, the user needs to manually pay [`Bolt12Invoice`]s when received.
+       ///
+       /// When set to true, [`Event::InvoiceReceived`] will be generated for each received
+       /// [`Bolt12Invoice`] instead of being automatically paid after verification.
+       ///
+       /// Default value: false.
+       ///
+       /// [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice
+       /// [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived
+       pub manually_handle_bolt12_invoices: bool,
 }
 
 impl Default for UserConfig {
@@ -860,6 +870,7 @@ impl Default for UserConfig {
                        manually_accept_inbound_channels: false,
                        accept_intercept_htlcs: false,
                        accept_mpp_keysend: false,
+                       manually_handle_bolt12_invoices: false,
                }
        }
 }
@@ -879,6 +890,7 @@ impl Readable for UserConfig {
                        manually_accept_inbound_channels: Readable::read(reader)?,
                        accept_intercept_htlcs: Readable::read(reader)?,
                        accept_mpp_keysend: Readable::read(reader)?,
+                       manually_handle_bolt12_invoices: Readable::read(reader)?,
                })
        }
 }