Skip to content

Commit 61ed636

Browse files
committed
Rename manually_handle_bolt12_invoices
1. Till now this UserConfig option was used to indicate whether the user wants to handles the payment for received Bolt12Invoices manually. 2. The future commits expand it's use case, so that it can also be used to indicate whether the user wants to handle response to the received Invoice Request manually as well. 3. Rename this UserConfig appropriately to better represent its use case.
1 parent 02973ea commit 61ed636

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lightning/src/events/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ pub enum Event {
823823
/// Indicates a [`Bolt12Invoice`] in response to an [`InvoiceRequest`] or a [`Refund`] was
824824
/// received.
825825
///
826-
/// This event will only be generated if [`UserConfig::manually_handle_bolt12_invoices`] is set.
826+
/// This event will only be generated if [`UserConfig::manually_handle_bolt12_messages`] is set.
827827
/// Use [`ChannelManager::send_payment_for_bolt12_invoice`] to pay the invoice or
828828
/// [`ChannelManager::abandon_payment`] to abandon the associated payment. See those docs for
829829
/// further details.
@@ -834,7 +834,7 @@ pub enum Event {
834834
///
835835
/// [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest
836836
/// [`Refund`]: crate::offers::refund::Refund
837-
/// [`UserConfig::manually_handle_bolt12_invoices`]: crate::util::config::UserConfig::manually_handle_bolt12_invoices
837+
/// [`UserConfig::manually_handle_bolt12_messages`]: crate::util::config::UserConfig::manually_handle_bolt12_messages
838838
/// [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
839839
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
840840
InvoiceReceived {

lightning/src/ln/channelmanager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11154,7 +11154,7 @@ where
1115411154
&self.logger, None, None, Some(invoice.payment_hash()),
1115511155
);
1115611156

11157-
if self.default_configuration.manually_handle_bolt12_invoices {
11157+
if self.default_configuration.manually_handle_bolt12_messages {
1115811158
let event = Event::InvoiceReceived {
1115911159
payment_id, invoice, context, responder,
1116011160
};

lightning/src/ln/offers_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ fn creates_and_pays_for_offer_with_retry() {
11461146
#[test]
11471147
fn pays_bolt12_invoice_asynchronously() {
11481148
let mut manually_pay_cfg = test_default_channel_config();
1149-
manually_pay_cfg.manually_handle_bolt12_invoices = true;
1149+
manually_pay_cfg.manually_handle_bolt12_messages = true;
11501150

11511151
let chanmon_cfgs = create_chanmon_cfgs(2);
11521152
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);

lightning/src/util/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ pub struct UserConfig {
859859
/// [`Event::InvoiceReceived`]: crate::events::Event::InvoiceReceived
860860
/// [`ChannelManager::send_payment_for_bolt12_invoice`]: crate::ln::channelmanager::ChannelManager::send_payment_for_bolt12_invoice
861861
/// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
862-
pub manually_handle_bolt12_invoices: bool,
862+
pub manually_handle_bolt12_messages: bool,
863863
}
864864

865865
impl Default for UserConfig {
@@ -873,7 +873,7 @@ impl Default for UserConfig {
873873
manually_accept_inbound_channels: false,
874874
accept_intercept_htlcs: false,
875875
accept_mpp_keysend: false,
876-
manually_handle_bolt12_invoices: false,
876+
manually_handle_bolt12_messages: false,
877877
}
878878
}
879879
}
@@ -893,7 +893,7 @@ impl Readable for UserConfig {
893893
manually_accept_inbound_channels: Readable::read(reader)?,
894894
accept_intercept_htlcs: Readable::read(reader)?,
895895
accept_mpp_keysend: Readable::read(reader)?,
896-
manually_handle_bolt12_invoices: Readable::read(reader)?,
896+
manually_handle_bolt12_messages: Readable::read(reader)?,
897897
})
898898
}
899899
}

0 commit comments

Comments
 (0)