Skip to content

Commit

Permalink
cosmetic change for better readable code
Browse files Browse the repository at this point in the history
  • Loading branch information
roeierez committed Aug 6, 2024
1 parent 5040acf commit eaa86fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/sdk-core/src/breez_services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ impl BreezServices {
self.start_node().await?;
let parsed_invoice = parse_invoice(req.bolt11.as_str())?;
let invoice_expiration = parsed_invoice.timestamp + parsed_invoice.expiry;
if invoice_expiration < SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs() {
let current_time = SystemTime::now().duration_since(UNIX_EPOCH)?.as_secs();
if invoice_expiration < current_time {
return Err(SendPaymentError::InvoiceExpired {
err: format!("Invoice expired at {}", invoice_expiration),
});
Expand Down

0 comments on commit eaa86fb

Please sign in to comment.