Skip to content

Commit 389b321

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 ee6fab9 commit 389b321

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
@@ -356,6 +357,7 @@ where
356357
channelmanager.create_bolt11_invoice(params)
357358
}
358359

360+
#[deprecated(note = "Use ChannelManager::create_bolt11_invoice instead.")]
359361
/// Utility to construct an invoice. Generally, unless you want to do something like a custom
360362
/// cltv_expiry, this is what you should be using to create an invoice. The reason being, this
361363
/// method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
@@ -400,6 +402,7 @@ where
400402
}
401403

402404

405+
#[deprecated(note = "Use ChannelManager::create_bolt11_invoice instead.")]
403406
/// See [`create_invoice_from_channelmanager`]
404407
/// This version allows for providing custom [`PaymentHash`] and description hash for the invoice.
405408
///
@@ -433,6 +436,7 @@ where
433436
channelmanager.create_bolt11_invoice(params)
434437
}
435438

439+
#[deprecated(note = "Use ChannelManager::create_bolt11_invoice instead.")]
436440
/// See [`create_invoice_from_channelmanager`]
437441
/// This version allows for providing a custom [`PaymentHash`] for the invoice.
438442
/// This may be useful if you're building an on-chain swap or involving another protocol where

0 commit comments

Comments
 (0)