@@ -313,7 +313,6 @@ fn rotate_through_iterators<T, I: Iterator<Item = T>>(mut vecs: Vec<I>) -> impl
313
313
} )
314
314
}
315
315
316
- #[ cfg( feature = "std" ) ]
317
316
/// Utility to construct an invoice. Generally, unless you want to do something like a custom
318
317
/// cltv_expiry, this is what you should be using to create an invoice. The reason being, this
319
318
/// method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
@@ -345,25 +344,18 @@ where
345
344
MR :: Target : MessageRouter ,
346
345
L :: Target : Logger ,
347
346
{
348
- use std:: time:: SystemTime ;
349
- let duration_since_epoch = SystemTime :: now ( )
350
- . duration_since ( SystemTime :: UNIX_EPOCH )
351
- . expect ( "for the foreseeable future this shouldn't happen" ) ;
352
-
353
347
let description = Description :: new ( description) . map_err ( SignOrCreationError :: CreationError ) ?;
354
348
let params = Bolt11InvoiceParameters {
355
349
currency : Some ( network) ,
356
350
amount_msats : amt_msat,
357
351
description : Bolt11InvoiceDescription :: Direct ( description) ,
358
- duration_since_epoch : Some ( duration_since_epoch) ,
359
352
invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
360
353
min_final_cltv_expiry_delta,
361
354
payment_hash : None ,
362
355
} ;
363
356
channelmanager. create_bolt11_invoice ( params)
364
357
}
365
358
366
- #[ cfg( feature = "std" ) ]
367
359
/// Utility to construct an invoice. Generally, unless you want to do something like a custom
368
360
/// cltv_expiry, this is what you should be using to create an invoice. The reason being, this
369
361
/// method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
@@ -396,16 +388,10 @@ where
396
388
MR :: Target : MessageRouter ,
397
389
L :: Target : Logger ,
398
390
{
399
- use std:: time:: SystemTime ;
400
- let duration_since_epoch = SystemTime :: now ( )
401
- . duration_since ( SystemTime :: UNIX_EPOCH )
402
- . expect ( "for the foreseeable future this shouldn't happen" ) ;
403
-
404
391
let params = Bolt11InvoiceParameters {
405
392
currency : Some ( network) ,
406
393
amount_msats : amt_msat,
407
394
description : Bolt11InvoiceDescription :: Hash ( description_hash) ,
408
- duration_since_epoch : Some ( duration_since_epoch) ,
409
395
invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
410
396
min_final_cltv_expiry_delta,
411
397
payment_hash : None ,
@@ -414,7 +400,6 @@ where
414
400
}
415
401
416
402
417
- #[ cfg( feature = "std" ) ]
418
403
/// See [`create_invoice_from_channelmanager`]
419
404
/// This version allows for providing custom [`PaymentHash`] and description hash for the invoice.
420
405
///
@@ -437,24 +422,17 @@ where
437
422
MR :: Target : MessageRouter ,
438
423
L :: Target : Logger ,
439
424
{
440
- use std:: time:: SystemTime ;
441
- let duration_since_epoch = SystemTime :: now ( )
442
- . duration_since ( SystemTime :: UNIX_EPOCH )
443
- . expect ( "for the foreseeable future this shouldn't happen" ) ;
444
-
445
425
let params = Bolt11InvoiceParameters {
446
426
currency : Some ( network) ,
447
427
amount_msats : amt_msat,
448
428
description : Bolt11InvoiceDescription :: Hash ( description_hash) ,
449
- duration_since_epoch : Some ( duration_since_epoch) ,
450
429
invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
451
430
min_final_cltv_expiry_delta,
452
431
payment_hash : Some ( payment_hash) ,
453
432
} ;
454
433
channelmanager. create_bolt11_invoice ( params)
455
434
}
456
435
457
- #[ cfg( feature = "std" ) ]
458
436
/// See [`create_invoice_from_channelmanager`]
459
437
/// This version allows for providing a custom [`PaymentHash`] for the invoice.
460
438
/// This may be useful if you're building an on-chain swap or involving another protocol where
@@ -475,17 +453,11 @@ where
475
453
MR :: Target : MessageRouter ,
476
454
L :: Target : Logger ,
477
455
{
478
- use std:: time:: SystemTime ;
479
- let duration_since_epoch = SystemTime :: now ( )
480
- . duration_since ( SystemTime :: UNIX_EPOCH )
481
- . expect ( "for the foreseeable future this shouldn't happen" ) ;
482
-
483
456
let description = Description :: new ( description) . map_err ( SignOrCreationError :: CreationError ) ?;
484
457
let params = Bolt11InvoiceParameters {
485
458
currency : Some ( network) ,
486
459
amount_msats : amt_msat,
487
460
description : Bolt11InvoiceDescription :: Direct ( description) ,
488
- duration_since_epoch : Some ( duration_since_epoch) ,
489
461
invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
490
462
min_final_cltv_expiry_delta,
491
463
payment_hash : Some ( payment_hash) ,
0 commit comments