handle invalid lnurl-w responses on redeem_lnurl_withdraw.
This commit is contained in:
parent
7134821fcd
commit
bcecf6d431
1 changed files with 13 additions and 7 deletions
|
|
@ -196,6 +196,7 @@ async def redeem_lnurl_withdraw(
|
||||||
r = await client.get(str(lnurl))
|
r = await client.get(str(lnurl))
|
||||||
res = r.json()
|
res = r.json()
|
||||||
|
|
||||||
|
try:
|
||||||
_, payment_request = await create_invoice(
|
_, payment_request = await create_invoice(
|
||||||
wallet_id=wallet_id,
|
wallet_id=wallet_id,
|
||||||
amount=int(res["maxWithdrawable"] / 1000),
|
amount=int(res["maxWithdrawable"] / 1000),
|
||||||
|
|
@ -203,6 +204,11 @@ async def redeem_lnurl_withdraw(
|
||||||
extra=extra,
|
extra=extra,
|
||||||
conn=conn,
|
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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue