mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 20:36:16 +02:00
handle invalid lnurl-w responses on redeem_lnurl_withdraw.
This commit is contained in:
@@ -196,13 +196,19 @@ async def redeem_lnurl_withdraw(
|
|||||||
r = await client.get(str(lnurl))
|
r = await client.get(str(lnurl))
|
||||||
res = r.json()
|
res = r.json()
|
||||||
|
|
||||||
_, payment_request = await create_invoice(
|
try:
|
||||||
wallet_id=wallet_id,
|
_, payment_request = await create_invoice(
|
||||||
amount=int(res["maxWithdrawable"] / 1000),
|
wallet_id=wallet_id,
|
||||||
memo=memo or res["defaultDescription"] or "",
|
amount=int(res["maxWithdrawable"] / 1000),
|
||||||
extra=extra,
|
memo=memo or res["defaultDescription"] or "",
|
||||||
conn=conn,
|
extra=extra,
|
||||||
)
|
conn=conn,
|
||||||
|
)
|
||||||
|
except:
|
||||||
|
print(
|
||||||
|
f"failed to create invoice on redeem_lnurl_withdraw from {lnurl}. params: {res}"
|
||||||
|
)
|
||||||
|
return None
|
||||||
|
|
||||||
if wait_seconds:
|
if wait_seconds:
|
||||||
await trio.sleep(wait_seconds)
|
await trio.sleep(wait_seconds)
|
||||||
|
Reference in New Issue
Block a user