File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,6 @@ pub fn payment_parameters_from_invoice(invoice: &Bolt11Invoice)
61
61
}
62
62
}
63
63
64
- fn expiry_time_from_unix_epoch ( invoice : & Bolt11Invoice ) -> Duration {
65
- invoice. signed_invoice . raw_invoice . data . timestamp . 0 + invoice. expiry_time ( )
66
- }
67
-
68
64
fn params_from_invoice ( invoice : & Bolt11Invoice , amount_msat : u64 )
69
65
-> ( PaymentHash , RecipientOnionFields , RouteParameters ) {
70
66
let payment_hash = PaymentHash ( ( * invoice. payment_hash ( ) ) . into_inner ( ) ) ;
@@ -76,8 +72,10 @@ fn params_from_invoice(invoice: &Bolt11Invoice, amount_msat: u64)
76
72
invoice. recover_payee_pub_key ( ) ,
77
73
invoice. min_final_cltv_expiry_delta ( ) as u32
78
74
)
79
- . with_expiry_time ( expiry_time_from_unix_epoch ( invoice) . as_secs ( ) )
80
75
. with_route_hints ( invoice. route_hints ( ) ) . unwrap ( ) ;
76
+ if let Some ( expiry) = invoice. expires_at ( ) {
77
+ payment_params = payment_params. with_expiry_time ( expiry) ;
78
+ }
81
79
if let Some ( features) = invoice. features ( ) {
82
80
payment_params = payment_params. with_bolt11_features ( features. clone ( ) ) . unwrap ( ) ;
83
81
}
You can’t perform that action at this time.
0 commit comments