@@ -313,7 +313,6 @@ fn rotate_through_iterators<T, I: Iterator<Item = T>>(mut vecs: Vec<I>) -> impl
313313 } )
314314}
315315
316- #[ cfg( feature = "std" ) ]
317316/// Utility to construct an invoice. Generally, unless you want to do something like a custom
318317/// cltv_expiry, this is what you should be using to create an invoice. The reason being, this
319318/// method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
@@ -345,25 +344,18 @@ where
345344 MR :: Target : MessageRouter ,
346345 L :: Target : Logger ,
347346{
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-
353347 let description = Description :: new ( description) . map_err ( SignOrCreationError :: CreationError ) ?;
354348 let params = Bolt11InvoiceParameters {
355349 currency : Some ( network) ,
356350 amount_msats : amt_msat,
357351 description : Bolt11InvoiceDescription :: Direct ( description) ,
358- duration_since_epoch : Some ( duration_since_epoch) ,
359352 invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
360353 min_final_cltv_expiry_delta,
361354 payment_hash : None ,
362355 } ;
363356 channelmanager. create_bolt11_invoice ( params)
364357}
365358
366- #[ cfg( feature = "std" ) ]
367359/// Utility to construct an invoice. Generally, unless you want to do something like a custom
368360/// cltv_expiry, this is what you should be using to create an invoice. The reason being, this
369361/// method stores the invoice's payment secret and preimage in `ChannelManager`, so (a) the user
@@ -396,16 +388,10 @@ where
396388 MR :: Target : MessageRouter ,
397389 L :: Target : Logger ,
398390{
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-
404391 let params = Bolt11InvoiceParameters {
405392 currency : Some ( network) ,
406393 amount_msats : amt_msat,
407394 description : Bolt11InvoiceDescription :: Hash ( description_hash) ,
408- duration_since_epoch : Some ( duration_since_epoch) ,
409395 invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
410396 min_final_cltv_expiry_delta,
411397 payment_hash : None ,
@@ -414,7 +400,6 @@ where
414400}
415401
416402
417- #[ cfg( feature = "std" ) ]
418403/// See [`create_invoice_from_channelmanager`]
419404/// This version allows for providing custom [`PaymentHash`] and description hash for the invoice.
420405///
@@ -437,24 +422,17 @@ where
437422 MR :: Target : MessageRouter ,
438423 L :: Target : Logger ,
439424{
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-
445425 let params = Bolt11InvoiceParameters {
446426 currency : Some ( network) ,
447427 amount_msats : amt_msat,
448428 description : Bolt11InvoiceDescription :: Hash ( description_hash) ,
449- duration_since_epoch : Some ( duration_since_epoch) ,
450429 invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
451430 min_final_cltv_expiry_delta,
452431 payment_hash : Some ( payment_hash) ,
453432 } ;
454433 channelmanager. create_bolt11_invoice ( params)
455434}
456435
457- #[ cfg( feature = "std" ) ]
458436/// See [`create_invoice_from_channelmanager`]
459437/// This version allows for providing a custom [`PaymentHash`] for the invoice.
460438/// This may be useful if you're building an on-chain swap or involving another protocol where
@@ -475,17 +453,11 @@ where
475453 MR :: Target : MessageRouter ,
476454 L :: Target : Logger ,
477455{
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-
483456 let description = Description :: new ( description) . map_err ( SignOrCreationError :: CreationError ) ?;
484457 let params = Bolt11InvoiceParameters {
485458 currency : Some ( network) ,
486459 amount_msats : amt_msat,
487460 description : Bolt11InvoiceDescription :: Direct ( description) ,
488- duration_since_epoch : Some ( duration_since_epoch) ,
489461 invoice_expiry_delta_secs : Some ( invoice_expiry_delta_secs) ,
490462 min_final_cltv_expiry_delta,
491463 payment_hash : Some ( payment_hash) ,
0 commit comments