Skip to content

Commit d0ab612

Browse files
committed
Remove unneeded util function
1 parent ffad819 commit d0ab612

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

lightning-invoice/src/payment.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ fn pay_invoice_using_amount<P: Deref>(
117117
recipient_onion.payment_metadata = invoice.payment_metadata().map(|v| v.clone());
118118
let mut payment_params = PaymentParameters::from_node_id(invoice.recover_payee_pub_key(),
119119
invoice.min_final_cltv_expiry_delta() as u32)
120-
.with_expiry_time(expiry_time_from_unix_epoch(invoice).as_secs())
120+
.with_expiry_time(invoice.expiry_time().as_secs())
121121
.with_route_hints(invoice.route_hints()).unwrap();
122122
if let Some(features) = invoice.features() {
123123
payment_params = payment_params.with_bolt11_features(features.clone()).unwrap();
@@ -149,7 +149,7 @@ where C::Target: AChannelManager,
149149
invoice.recover_payee_pub_key(),
150150
invoice.min_final_cltv_expiry_delta() as u32,
151151
)
152-
.with_expiry_time(expiry_time_from_unix_epoch(invoice).as_secs())
152+
.with_expiry_time(invoice.expiry_time().as_secs())
153153
.with_route_hints(invoice.route_hints())
154154
.unwrap();
155155

@@ -180,7 +180,7 @@ where C::Target: AChannelManager,
180180
invoice.recover_payee_pub_key(),
181181
invoice.min_final_cltv_expiry_delta() as u32,
182182
)
183-
.with_expiry_time(expiry_time_from_unix_epoch(invoice).as_secs())
183+
.with_expiry_time(invoice.expiry_time().as_secs())
184184
.with_route_hints(invoice.route_hints())
185185
.unwrap();
186186

@@ -193,10 +193,6 @@ where C::Target: AChannelManager,
193193
.map_err(ProbingError::Sending)
194194
}
195195

196-
fn expiry_time_from_unix_epoch(invoice: &Bolt11Invoice) -> Duration {
197-
invoice.signed_invoice.raw_invoice.data.timestamp.0 + invoice.expiry_time()
198-
}
199-
200196
/// An error that may occur when making a payment.
201197
#[derive(Clone, Debug, PartialEq, Eq)]
202198
pub enum PaymentError {

0 commit comments

Comments
 (0)