delete pending payments after WALLET.pay_invoice fails.
fixes https://github.com/lnbits/lnbits/issues/138
This commit is contained in:
parent
9dd040186d
commit
9c126696fc
1 changed files with 3 additions and 1 deletions
|
|
@ -139,10 +139,12 @@ async def pay_invoice(
|
||||||
**payment_kwargs,
|
**payment_kwargs,
|
||||||
)
|
)
|
||||||
await delete_payment(temp_id)
|
await delete_payment(temp_id)
|
||||||
|
await db.commit()
|
||||||
else:
|
else:
|
||||||
|
await delete_payment(temp_id)
|
||||||
|
await db.commit()
|
||||||
raise Exception(payment.error_message or "Failed to pay_invoice on backend.")
|
raise Exception(payment.error_message or "Failed to pay_invoice on backend.")
|
||||||
|
|
||||||
await db.commit()
|
|
||||||
return invoice.payment_hash
|
return invoice.payment_hash
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue