Skip to content

Commit

Permalink
Add ordering display by number of UTXOs
Browse files Browse the repository at this point in the history
  • Loading branch information
walkjivefly committed Mar 6, 2021
1 parent 05c0051 commit a7ea02e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(self):
uic.loadUi('UI/SweeperMainPage.ui', self)

self.setWindowIcon(QIcon('img/sweeper.ico'))
ordering = ['Largest', 'Smallest', 'Label']
ordering = ['Largest', 'Smallest', 'Label', 'UTXOs']
self.order_combobox.addItems(ordering)
self.options = Options()
self.connectEvents()
Expand Down
3 changes: 3 additions & 0 deletions src/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def refresh(widget, options):
'data': [address, info['total'], info['account'], str(n_transactions)],
'label': info['account'],
'amount': info['total'],
'utxo': n_transactions,
}
addresses.append(elem)
spendable_amount += info['total']
Expand Down Expand Up @@ -149,3 +150,5 @@ def order(addresses, by):
addresses.sort(key=lambda k: k['amount'], reverse=True)
elif by == 'Label':
addresses.sort(key=lambda k: k['label'])
elif by == 'UTXOs':
addresses.sort(key=lambda k: k['utxo'], reverse=True)

0 comments on commit a7ea02e

Please sign in to comment.