commit 98a1c9268a2ebe569d454014699df1c14be671f5
parent bd5c83e906e03930c65015784eaf176e2d47b99b
Author: ThomasV <thomasv@electrum.org>
Date: Mon, 12 Aug 2019 18:17:47 +0200
qt: do not show paid requests
Diffstat:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/electrum/gui/qt/invoice_list.py b/electrum/gui/qt/invoice_list.py
@@ -45,6 +45,7 @@ REQUEST_TYPE_LN = 1
ROLE_REQUEST_TYPE = Qt.UserRole
ROLE_REQUEST_ID = Qt.UserRole + 1
+from electrum.paymentrequest import PR_PAID
class InvoiceList(MyTreeView):
@@ -92,11 +93,13 @@ class InvoiceList(MyTreeView):
self.model().insertRow(idx, items)
lnworker = self.parent.wallet.lnworker
- items = lnworker.invoices.items() if lnworker else []
+ items = list(lnworker.invoices.items()) if lnworker else []
for key, (invoice, direction, is_paid) in items:
if direction == RECEIVED:
continue
status = lnworker.get_invoice_status(key)
+ if status == PR_PAID:
+ continue
lnaddr = lndecode(invoice, expected_hrp=constants.net.SEGWIT_HRP)
amount_sat = lnaddr.amount*COIN if lnaddr.amount else None
amount_str = self.parent.format_amount(amount_sat) if amount_sat else ''
diff --git a/electrum/gui/qt/request_list.py b/electrum/gui/qt/request_list.py
@@ -107,12 +107,14 @@ class RequestList(MyTreeView):
self.model().clear()
self.update_headers(self.__class__.headers)
for req in self.wallet.get_sorted_requests(self.config):
+ status = req.get('status')
+ if status == PR_PAID:
+ continue
request_type = REQUEST_TYPE_LN if req.get('lightning', False) else REQUEST_TYPE_BITCOIN
timestamp = req.get('time', 0)
amount = req.get('amount')
message = req['memo']
date = format_time(timestamp)
- status = req.get('status')
amount_str = self.parent.format_amount(amount) if amount else ""
labels = [date, message, amount_str, pr_tooltips.get(status,'')]
items = [QStandardItem(e) for e in labels]