Index request by ID instead of receiving address.
Replace get_key_for_outgoing_invoice, get_key_for_incoming_request with Invoice.get_id() When a new request is created, reuse addresses of expired requests (fixes #7927) The API is changed for the following commands: get_request, get_invoice, list_requests, list_invoices, delete_request, delete_invoice
This commit is contained in:
@@ -137,6 +137,10 @@ class Invoice(StoredObject):
|
||||
# 0 means never
|
||||
return self.exp + self.time if self.exp else 0
|
||||
|
||||
def has_expired(self) -> bool:
|
||||
exp = self.get_expiration_date()
|
||||
return bool(exp) and exp < time.time()
|
||||
|
||||
def get_amount_msat(self) -> Union[int, str, None]:
|
||||
return self.amount_msat
|
||||
|
||||
|
||||
Reference in New Issue
Block a user