bug: increment before paying (#23)
Some checks failed
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled

fixes issue in used withdraws
This commit is contained in:
dni ⚡ 2024-02-06 12:56:29 +01:00 committed by GitHub
commit 2fc4fad757
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,13 +111,13 @@ async def api_lnurl_callback(
) )
try: try:
await increment_withdraw_link(link)
payment_hash = await pay_invoice( payment_hash = await pay_invoice(
wallet_id=link.wallet, wallet_id=link.wallet,
payment_request=pr, payment_request=pr,
max_sat=link.max_withdrawable, max_sat=link.max_withdrawable,
extra={"tag": "withdraw"}, extra={"tag": "withdraw"},
) )
await increment_withdraw_link(link)
if link.webhook_url: if link.webhook_url:
await dispatch_webhook(link, payment_hash, pr) await dispatch_webhook(link, payment_hash, pr)
return {"status": "OK"} return {"status": "OK"}