Skip to content

Commit

Permalink
Fix bug reported by AustEcon, where the expected payment request list…
Browse files Browse the repository at this point in the history
… was not correctly filtering for entries and was missing the unpaid invoices (they would show when moved to paid status).
  • Loading branch information
rt121212121 authored and AustEcon committed Mar 21, 2023
1 parent 222d3ee commit 38d4884
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions electrumsv/gui/qt/request_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,22 @@ def on_update(self) -> None:
current_time = get_posix_timestamp()
nearest_expiry_time = float('inf')

# NOTE(rt12) @InvoiceDisplayAndRetention It is envisioned that the user will create lots
# of invoices and we will allow them to be PaymentFlag.ARCHIVED (currently covered in
# PaymentFlag.MASK_HIDDEN). A user might have some way of selecting which invoices
# are shown and filtering and toggling the flag. The difference between
# PaymentFlag.DELETED and PaymentFlag.ARCHIVED is we will either automatically or
# manually prune those that have PaymentFlag.DELETED.
wallet = self._account._wallet
rows = wallet.data.read_payment_requests(account_id=self._account_id,
flags=PaymentFlag.NONE, mask=PaymentFlag.MASK_HIDDEN | PaymentFlag.STATE_PREPARING)
flags=PaymentFlag.NONE, mask=PaymentFlag.MASK_HIDDEN)

# clear the list and fill it again
self.clear()
for row in rows:
request_state = row.request_flags & PaymentFlag.MASK_STATE
if request_state not in { PaymentFlag.STATE_UNPAID, PaymentFlag.STATE_PAID }:
continue

if request_state == PaymentFlag.STATE_UNPAID and row.date_expires is not None:
date_expires = row.date_expires
if current_time + 5 > date_expires:
Expand Down

0 comments on commit 38d4884

Please sign in to comment.