[FIX] correct amount in fiat tracking (#1934)

* better debug log

* fix: convert msat to sat for fiat amount
This commit is contained in:
jackstar12 2023-09-12 11:06:35 +02:00 committed by GitHub
parent fb98576431
commit 6360f23495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,7 +92,9 @@ async def calculate_fiat_amounts(
extra["wallet_fiat_amount"] = round(fiat_amount, ndigits=3)
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
@ -185,7 +187,7 @@ async def pay_invoice(
raise ValueError("Amount in invoice is too high.")
_, 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