Skip to content

Commit b6ceafb

Browse files
committed
Deprecate functions in invoice_utils module
ChannelManager::create_bolt11_invoice is a simpler and more flexible way of creating a BOLT11 invoice, so deprecate the corresponding functions in the invoice_utils module.
1 parent ce0e182 commit b6ceafb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/invoice_utils.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ fn rotate_through_iterators<T, I: Iterator<Item = T>>(mut vecs: Vec<I>) -> impl
313313
})
314314
}
315315

316+
#[deprecated(note = "Use ChannelManager::create_bolt11_invoice instead.")]
316317
/// Utility to construct an invoice. Generally, unless you want to do something like a custom
317318
/// cltv_expiry, this is what you should be using to create an invoice. The reason being, this
318319
/// method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
@@ -354,6 +355,7 @@ where
354355
channelmanager.create_bolt11_invoice(params)
355356
}
356357

358+
#[deprecated(note = "Use ChannelManager::create_bolt11_invoice instead.")]
357359
/// Utility to construct an invoice. Generally, unless you want to do something like a custom
358360
/// cltv_expiry, this is what you should be using to create an invoice. The reason being, this
359361
/// method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
@@ -396,6 +398,7 @@ where
396398
channelmanager.create_bolt11_invoice(params)
397399
}
398400

401+
#[deprecated(note = "Use ChannelManager::create_bolt11_invoice instead.")]
399402
/// See [`create_invoice_from_channelmanager`].
400403
///
401404
/// This version allows for providing custom [`PaymentHash`] and description hash for the invoice.
@@ -429,6 +432,7 @@ where
429432
channelmanager.create_bolt11_invoice(params)
430433
}
431434

435+
#[deprecated(note = "Use ChannelManager::create_bolt11_invoice instead.")]
432436
/// See [`create_invoice_from_channelmanager`].
433437
///
434438
/// This version allows for providing a custom [`PaymentHash`] for the invoice.

0 commit comments

Comments
 (0)