mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-29 16:31:29 +00:00
qt history list: "status"-based sort should also tie-break on height
This commit is contained in:
parent
65e8eef87f
commit
b1e15751d6
1 changed files with 4 additions and 1 deletions
|
@ -98,6 +98,7 @@ class HistoryModel(QAbstractItemModel, PrintError):
|
||||||
tx_hash = tx_item['txid']
|
tx_hash = tx_item['txid']
|
||||||
conf = tx_item['confirmations']
|
conf = tx_item['confirmations']
|
||||||
txpos = tx_item['txpos_in_block'] or 0
|
txpos = tx_item['txpos_in_block'] or 0
|
||||||
|
height = tx_item['height']
|
||||||
try:
|
try:
|
||||||
status, status_str = self.tx_status_cache[tx_hash]
|
status, status_str = self.tx_status_cache[tx_hash]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -106,7 +107,9 @@ class HistoryModel(QAbstractItemModel, PrintError):
|
||||||
if role == Qt.UserRole:
|
if role == Qt.UserRole:
|
||||||
# for sorting
|
# for sorting
|
||||||
d = {
|
d = {
|
||||||
0: (status, conf, -txpos),
|
# height breaks ties for unverified txns
|
||||||
|
# txpos breaks ties for verified same block txns
|
||||||
|
0: (status, conf, -height, -txpos),
|
||||||
1: status_str,
|
1: status_str,
|
||||||
2: tx_item['label'],
|
2: tx_item['label'],
|
||||||
3: tx_item['value'].value,
|
3: tx_item['value'].value,
|
||||||
|
|
Loading…
Add table
Reference in a new issue