From 090cf414e7754d1eb290310b7e0f3826513bf044 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Thu, 22 Dec 2022 19:58:01 +0100 Subject: [PATCH] cashu: add more logging --- lnbits/extensions/cashu/views_api.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lnbits/extensions/cashu/views_api.py b/lnbits/extensions/cashu/views_api.py index 2d10f3f08..2e613b07e 100644 --- a/lnbits/extensions/cashu/views_api.py +++ b/lnbits/extensions/cashu/views_api.py @@ -299,14 +299,20 @@ async def melt_coins( cashu.wallet, invoice_obj.payment_hash ) if status.paid == True: - logger.debug("Cashu: Payment successful, invalidating proofs") + logger.debug( + f"Cashu: Payment successful, invalidating proofs for {invoice_obj.payment_hash}" + ) await ledger._invalidate_proofs(proofs) + else: + logger.debug(f"Cashu: Payment failed for {invoice_obj.payment_hash}") except Exception as e: + logger.debug(f"Cashu: Exception for {invoice_obj.payment_hash}: {e}") raise HTTPException( status_code=HTTPStatus.BAD_REQUEST, detail=f"Cashu: {str(e)}", ) finally: + logger.debug(f"Cashu: Unset pending for {invoice_obj.payment_hash}: {e}") # delete proofs from pending list await ledger._unset_proofs_pending(proofs)