mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 02:35:20 +00:00
qt history list: sorting of first column now considers txpos
same block txns were in unnatural order, maybe sort is not stable?
This commit is contained in:
parent
1c0c21159b
commit
e023d8abdd
2 changed files with 6 additions and 5 deletions
|
@ -92,6 +92,7 @@ class HistoryModel(QAbstractItemModel):
|
||||||
tx_item = self.transactions[index.row()]
|
tx_item = self.transactions[index.row()]
|
||||||
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
|
||||||
try:
|
try:
|
||||||
status, status_str = self.tx_status_cache[tx_hash]
|
status, status_str = self.tx_status_cache[tx_hash]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
@ -100,7 +101,7 @@ class HistoryModel(QAbstractItemModel):
|
||||||
if role == Qt.UserRole:
|
if role == Qt.UserRole:
|
||||||
# for sorting
|
# for sorting
|
||||||
d = {
|
d = {
|
||||||
0: (status, conf), # FIXME tx_pos needed as tie-breaker
|
0: (status, conf, -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,
|
||||||
|
@ -206,10 +207,9 @@ class HistoryModel(QAbstractItemModel):
|
||||||
self.tx_status_cache.clear()
|
self.tx_status_cache.clear()
|
||||||
for tx_item in self.transactions:
|
for tx_item in self.transactions:
|
||||||
txid = tx_item['txid']
|
txid = tx_item['txid']
|
||||||
height = tx_item['height']
|
tx_mined_status = TxMinedInfo(height=tx_item['height'],
|
||||||
conf = tx_item['confirmations']
|
conf=tx_item['confirmations'],
|
||||||
timestamp = tx_item['timestamp']
|
timestamp=tx_item['timestamp'])
|
||||||
tx_mined_status = TxMinedInfo(height=height, conf=conf, timestamp=timestamp)
|
|
||||||
self.tx_status_cache[txid] = self.parent.wallet.get_tx_status(txid, tx_mined_status)
|
self.tx_status_cache[txid] = self.parent.wallet.get_tx_status(txid, tx_mined_status)
|
||||||
|
|
||||||
history = self.parent.fx.show_history()
|
history = self.parent.fx.show_history()
|
||||||
|
|
|
@ -420,6 +420,7 @@ class Abstract_Wallet(AddressSynchronizer):
|
||||||
'balance': Satoshis(balance),
|
'balance': Satoshis(balance),
|
||||||
'date': timestamp_to_datetime(timestamp),
|
'date': timestamp_to_datetime(timestamp),
|
||||||
'label': self.get_label(tx_hash),
|
'label': self.get_label(tx_hash),
|
||||||
|
'txpos_in_block': tx_mined_status.txpos,
|
||||||
}
|
}
|
||||||
tx_fee = None
|
tx_fee = None
|
||||||
if show_fees:
|
if show_fees:
|
||||||
|
|
Loading…
Add table
Reference in a new issue