fix: stuck pay_invoice (#2783)

db connection wasnt passed to `get_user_active_extensions_id`. and in
some contexts nested db connection will stuck the server
This commit is contained in:
dni ⚡
2024-11-28 11:50:15 +01:00
committed by GitHub
parent e3d6b6befa
commit f5ccf5c157
2 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -520,14 +520,14 @@ async def _check_wallet_for_payment(
wallet_id: str,
tag: str,
amount_msat: int,
conn: Optional[Connection],
conn: Optional[Connection] = None,
):
wallet = await get_wallet(wallet_id, conn=conn)
if not wallet:
raise PaymentError(f"Could not fetch wallet '{wallet_id}'.", status="failed")
# check if the payment is made for an extension that the user disabled
status = await check_user_extension_access(wallet.user, tag)
status = await check_user_extension_access(wallet.user, tag, conn=conn)
if not status.success:
raise PaymentError(status.message)