1
0

follow-up prev commit: use maxsize to sort timestamps

This commit is contained in:
ThomasV
2019-01-31 19:43:11 +01:00
parent f04e10f61a
commit 776caeeff0

View File

@@ -24,6 +24,7 @@
# SOFTWARE.
import os
import sys
import datetime
from datetime import date
from typing import TYPE_CHECKING, Tuple, Dict
@@ -138,7 +139,11 @@ class HistoryModel(QAbstractItemModel, Logger):
timestamp = tx_item['timestamp']
if is_lightning:
status = 0
status_str = format_time(int(timestamp))
if timestamp is None:
timestamp = sys.maxsize
status_str = 'unconfirmed'
else:
status_str = format_time(int(timestamp))
else:
tx_hash = tx_item['txid']
conf = tx_item['confirmations']
@@ -151,7 +156,7 @@ class HistoryModel(QAbstractItemModel, Logger):
status, status_str = self.parent.wallet.get_tx_status(tx_hash, tx_mined_info)
# we sort by timestamp
if conf<=0:
timestamp = time.time()
timestamp = sys.maxsize
if role == Qt.UserRole:
# for sorting