be extra safe when failing a payment if pay_invoice throws on sparko.

This commit is contained in:
fiatjaf
2021-03-24 02:02:54 -03:00
parent aabe3364f4
commit a787d60d93
3 changed files with 32 additions and 5 deletions
+2 -1
View File
@@ -140,11 +140,12 @@ async def pay_invoice(
else:
# actually pay the external invoice
payment: PaymentResponse = await WALLET.pay_invoice(payment_request)
if payment.ok and payment.checking_id:
if payment.checking_id:
await create_payment(
checking_id=payment.checking_id,
fee=payment.fee_msat,
preimage=payment.preimage,
pending=payment.ok == None,
**payment_kwargs,
)
await delete_payment(temp_id)