From: tobtoht Date: Sun, 21 Jan 2024 15:36:50 +0000 (+0100) Subject: History: sort by blockheight for date ordering X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=f291649ce2615039dca8e3995fc2f2a0db65898a;p=gamesguru%2Ffeather.git History: sort by blockheight for date ordering --- diff --git a/src/model/TransactionHistoryModel.cpp b/src/model/TransactionHistoryModel.cpp index b8ffcb4d..1cbc17b5 100644 --- a/src/model/TransactionHistoryModel.cpp +++ b/src/model/TransactionHistoryModel.cpp @@ -146,7 +146,10 @@ QVariant TransactionHistoryModel::parseTransactionInfo(const TransactionRow &tIn case Column::Date: { if (role == Qt::UserRole) { - return tInfo.timestamp(); + if (tInfo.blockHeight() > 0) { + return tInfo.blockHeight(); + } + return tInfo.timestamp().toMSecsSinceEpoch(); } return tInfo.timestamp().toString(QString("%1 %2 ").arg(conf()->get(Config::dateFormat).toString(), conf()->get(Config::timeFormat).toString()));