From 776caeeff00f34d9380a16b431f0740ca9196ca9 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Thu, 31 Jan 2019 19:43:11 +0100 Subject: [PATCH] follow-up prev commit: use maxsize to sort timestamps --- electrum/gui/qt/history_list.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qt/history_list.py b/electrum/gui/qt/history_list.py index 23c617969..061d0e748 100644 --- a/electrum/gui/qt/history_list.py +++ b/electrum/gui/qt/history_list.py @@ -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