mirror of
https://github.com/lnbits/lnbits.git
synced 2025-03-30 04:32:01 +02:00
[FIX] correct amount in fiat tracking (#1934)
* better debug log * fix: convert msat to sat for fiat amount
This commit is contained in:
parent
fb98576431
commit
6360f23495
@ -92,7 +92,9 @@ async def calculate_fiat_amounts(
|
|||||||
extra["wallet_fiat_amount"] = round(fiat_amount, ndigits=3)
|
extra["wallet_fiat_amount"] = round(fiat_amount, ndigits=3)
|
||||||
extra["wallet_fiat_rate"] = amount_sat / fiat_amount
|
extra["wallet_fiat_rate"] = amount_sat / fiat_amount
|
||||||
|
|
||||||
logger.debug(f"Calculated fiat amounts for {wallet}: {extra=}")
|
logger.debug(
|
||||||
|
f"Calculated fiat amounts {wallet.id=} {amount=} {currency=}: {extra=}"
|
||||||
|
)
|
||||||
|
|
||||||
return amount_sat, extra
|
return amount_sat, extra
|
||||||
|
|
||||||
@ -185,7 +187,7 @@ async def pay_invoice(
|
|||||||
raise ValueError("Amount in invoice is too high.")
|
raise ValueError("Amount in invoice is too high.")
|
||||||
|
|
||||||
_, extra = await calculate_fiat_amounts(
|
_, extra = await calculate_fiat_amounts(
|
||||||
invoice.amount_msat, wallet_id, extra=extra, conn=conn
|
invoice.amount_msat / 1000, wallet_id, extra=extra, conn=conn
|
||||||
)
|
)
|
||||||
|
|
||||||
# put all parameters that don't change here
|
# put all parameters that don't change here
|
||||||
|
Loading…
x
Reference in New Issue
Block a user