This commit is contained in:
thesimplekid
2025-01-05 14:42:44 +00:00
committed by GitHub
parent d6b7d49ea9
commit 6a8a5a7941
27 changed files with 222 additions and 145 deletions

View File

@@ -152,16 +152,9 @@ impl MintLightning for LNbits {
return Err(Self::Err::Anyhow(anyhow!("Unsupported unit")));
}
let invoice_amount_msat = melt_quote_request
.request
.amount_milli_satoshis()
.ok_or(Error::UnknownInvoiceAmount)?;
let amount = melt_quote_request.amount_msat()?;
let amount = to_unit(
invoice_amount_msat,
&CurrencyUnit::Msat,
&melt_quote_request.unit,
)?;
let amount = amount / MSAT_IN_SAT.into();
let relative_fee_reserve =
(self.fee_reserve.percent_fee_reserve * u64::from(amount) as f32) as u64;