Browse Source

qt history list: sorting of first column now considers txpos

same block txns were in unnatural order, maybe sort is not stable?
3.3.3.1
SomberNight 6 years ago
parent
commit
e023d8abdd
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 10
      electrum/gui/qt/history_list.py
  2. 1
      electrum/wallet.py

10
electrum/gui/qt/history_list.py

@ -92,6 +92,7 @@ class HistoryModel(QAbstractItemModel):
tx_item = self.transactions[index.row()]
tx_hash = tx_item['txid']
conf = tx_item['confirmations']
txpos = tx_item['txpos_in_block'] or 0
try:
status, status_str = self.tx_status_cache[tx_hash]
except KeyError:
@ -100,7 +101,7 @@ class HistoryModel(QAbstractItemModel):
if role == Qt.UserRole:
# for sorting
d = {
0: (status, conf), # FIXME tx_pos needed as tie-breaker
0: (status, conf, -txpos),
1: status_str,
2: tx_item['label'],
3: tx_item['value'].value,
@ -206,10 +207,9 @@ class HistoryModel(QAbstractItemModel):
self.tx_status_cache.clear()
for tx_item in self.transactions:
txid = tx_item['txid']
height = tx_item['height']
conf = tx_item['confirmations']
timestamp = tx_item['timestamp']
tx_mined_status = TxMinedInfo(height=height, conf=conf, timestamp=timestamp)
tx_mined_status = TxMinedInfo(height=tx_item['height'],
conf=tx_item['confirmations'],
timestamp=tx_item['timestamp'])
self.tx_status_cache[txid] = self.parent.wallet.get_tx_status(txid, tx_mined_status)
history = self.parent.fx.show_history()

1
electrum/wallet.py

@ -420,6 +420,7 @@ class Abstract_Wallet(AddressSynchronizer):
'balance': Satoshis(balance),
'date': timestamp_to_datetime(timestamp),
'label': self.get_label(tx_hash),
'txpos_in_block': tx_mined_status.txpos,
}
tx_fee = None
if show_fees:

Loading…
Cancel
Save