improve checking routine.

check pending invoices only once on startup,
then check outgoing payments every 30 minutes,
and delete outgoing payments that return False (meaning they have failed).

also fix a bug on sparko.
This commit is contained in:
fiatjaf
2021-03-28 00:11:45 -03:00
parent b2efd71d3c
commit e112258c39
4 changed files with 37 additions and 9 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ class SparkWallet(Wallet):
if pay["status"] == "failed":
return PaymentResponse(False, None, 0, None, str(exc))
elif pay["status"] == "pending":
return PaymentResponse(None, listpays["pays"], 0, None, None)
return PaymentResponse(None, payment_hash, 0, None, None)
elif pay["status"] == "complete":
r = pay
r["payment_preimage"] = pay["preimage"]