follow-up prev commit: use maxsize to sort timestamps
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import datetime
|
import datetime
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from typing import TYPE_CHECKING, Tuple, Dict
|
from typing import TYPE_CHECKING, Tuple, Dict
|
||||||
@@ -138,7 +139,11 @@ class HistoryModel(QAbstractItemModel, Logger):
|
|||||||
timestamp = tx_item['timestamp']
|
timestamp = tx_item['timestamp']
|
||||||
if is_lightning:
|
if is_lightning:
|
||||||
status = 0
|
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:
|
else:
|
||||||
tx_hash = tx_item['txid']
|
tx_hash = tx_item['txid']
|
||||||
conf = tx_item['confirmations']
|
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)
|
status, status_str = self.parent.wallet.get_tx_status(tx_hash, tx_mined_info)
|
||||||
# we sort by timestamp
|
# we sort by timestamp
|
||||||
if conf<=0:
|
if conf<=0:
|
||||||
timestamp = time.time()
|
timestamp = sys.maxsize
|
||||||
|
|
||||||
if role == Qt.UserRole:
|
if role == Qt.UserRole:
|
||||||
# for sorting
|
# for sorting
|
||||||
|
|||||||
Reference in New Issue
Block a user