@@ -294,12 +294,12 @@ pub fn create_invoice_from_channelmanager_with_description_hash_and_duration_sin
294
294
network : Currency , amt_msat : Option < u64 > , description_hash : Sha256 ,
295
295
duration_since_epoch : Duration , invoice_expiry_delta_secs : u32
296
296
) -> Result < Invoice , SignOrCreationError < ( ) > >
297
- where
298
- M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
299
- T :: Target : BroadcasterInterface ,
300
- K :: Target : KeysInterface ,
301
- F :: Target : FeeEstimator ,
302
- L :: Target : Logger ,
297
+ where
298
+ M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
299
+ T :: Target : BroadcasterInterface ,
300
+ K :: Target : KeysInterface ,
301
+ F :: Target : FeeEstimator ,
302
+ L :: Target : Logger ,
303
303
{
304
304
_create_invoice_from_channelmanager_and_duration_since_epoch (
305
305
channelmanager, keys_manager, logger, network, amt_msat,
@@ -316,12 +316,12 @@ pub fn create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T:
316
316
network : Currency , amt_msat : Option < u64 > , description : String , duration_since_epoch : Duration ,
317
317
invoice_expiry_delta_secs : u32
318
318
) -> Result < Invoice , SignOrCreationError < ( ) > >
319
- where
320
- M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
321
- T :: Target : BroadcasterInterface ,
322
- K :: Target : KeysInterface ,
323
- F :: Target : FeeEstimator ,
324
- L :: Target : Logger ,
319
+ where
320
+ M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
321
+ T :: Target : BroadcasterInterface ,
322
+ K :: Target : KeysInterface ,
323
+ F :: Target : FeeEstimator ,
324
+ L :: Target : Logger ,
325
325
{
326
326
_create_invoice_from_channelmanager_and_duration_since_epoch (
327
327
channelmanager, keys_manager, logger, network, amt_msat,
@@ -337,12 +337,12 @@ fn _create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Der
337
337
network : Currency , amt_msat : Option < u64 > , description : InvoiceDescription ,
338
338
duration_since_epoch : Duration , invoice_expiry_delta_secs : u32
339
339
) -> Result < Invoice , SignOrCreationError < ( ) > >
340
- where
341
- M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
342
- T :: Target : BroadcasterInterface ,
343
- K :: Target : KeysInterface ,
344
- F :: Target : FeeEstimator ,
345
- L :: Target : Logger ,
340
+ where
341
+ M :: Target : chain:: Watch < <K :: Target as KeysInterface >:: Signer > ,
342
+ T :: Target : BroadcasterInterface ,
343
+ K :: Target : KeysInterface ,
344
+ F :: Target : FeeEstimator ,
345
+ L :: Target : Logger ,
346
346
{
347
347
// `create_inbound_payment` only returns an error if the amount is greater than the total bitcoin
348
348
// supply.
@@ -354,8 +354,9 @@ fn _create_invoice_from_channelmanager_and_duration_since_epoch<M: Deref, T: Der
354
354
}
355
355
356
356
/// See [`create_invoice_from_channelmanager_and_duration_since_epoch`]
357
- ///Function that allows to construct invoices with the given payment hash.
358
- ///This may be useful if you're building an on-chain swap or integrating with another protocol where the payment hash is fixed outside of lightning.
357
+ /// This version allows for providing a custom [`PaymentHash`] for the invoice.
358
+ /// This may be useful if you're building an on-chain swap or involving another protocol where
359
+ /// the payment hash is also involved outside the scope of lightning.
359
360
pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash < M : Deref , T : Deref , K : Deref , F : Deref , L : Deref > (
360
361
channelmanager : & ChannelManager < M , T , K , F , L > , keys_manager : K , logger : L ,
361
362
network : Currency , amt_msat : Option < u64 > , description : String , duration_since_epoch : Duration ,
@@ -369,7 +370,7 @@ pub fn create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_
369
370
L :: Target : Logger ,
370
371
{
371
372
let payment_secret = channelmanager
372
- . create_inbound_payment_for_hash ( payment_hash, amt_msat, invoice_expiry_delta_secs)
373
+ . create_inbound_payment_for_hash ( payment_hash, amt_msat, invoice_expiry_delta_secs)
373
374
. map_err ( |( ) | SignOrCreationError :: CreationError ( CreationError :: InvalidAmount ) ) ?;
374
375
_create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash (
375
376
channelmanager, keys_manager, logger, network, amt_msat,
0 commit comments