mirror of
https://github.com/aljazceru/cdk.git
synced 2025-12-22 23:25:22 +01:00
feat: use checked addition for u64
This commit is contained in:
@@ -506,7 +506,13 @@ impl MintLightning for Lnd {
|
||||
payment_lookup_id: payment_hash.to_string(),
|
||||
payment_preimage: Some(update.payment_preimage),
|
||||
status: MeltQuoteState::Paid,
|
||||
total_spent: Amount::from((update.value_sat + update.fee_sat) as u64),
|
||||
total_spent: Amount::from(
|
||||
(update
|
||||
.value_sat
|
||||
.checked_add(update.fee_sat)
|
||||
.ok_or(Error::AmountOverflow)?)
|
||||
as u64,
|
||||
),
|
||||
unit: CurrencyUnit::Sat,
|
||||
},
|
||||
PaymentStatus::Failed => PayInvoiceResponse {
|
||||
|
||||
Reference in New Issue
Block a user