qt: do not show paid requests
This commit is contained in:
@@ -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 ''
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user