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:
@@ -30,6 +30,20 @@ class PaymentStatus(NamedTuple):
|
||||
def pending(self) -> bool:
|
||||
return self.paid is not True
|
||||
|
||||
@property
|
||||
def failed(self) -> bool:
|
||||
return self.paid == False
|
||||
|
||||
def __str__(self) -> str:
|
||||
if self.paid == True:
|
||||
return "settled"
|
||||
elif self.paid == False:
|
||||
return "failed"
|
||||
elif self.paid == None:
|
||||
return "still pending"
|
||||
else:
|
||||
return "unknown (should never happen)"
|
||||
|
||||
|
||||
class Wallet(ABC):
|
||||
@abstractmethod
|
||||
|
||||
Reference in New Issue
Block a user