diff --git a/electrum/gui/qt/invoice_list.py b/electrum/gui/qt/invoice_list.py index a0c3c77a9..cc672e89d 100644 --- 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 index 2bc56c9ad..63de0e212 100644 --- 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]