From f012e4d9684344651c9031191b1ab4e473b4d216 Mon Sep 17 00:00:00 2001 From: Jaquee Date: Sat, 31 Dec 2016 14:56:08 +0100 Subject: history: show pending on top --- src/model/TransactionHistoryModel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/model/TransactionHistoryModel.cpp') diff --git a/src/model/TransactionHistoryModel.cpp b/src/model/TransactionHistoryModel.cpp index 333893aa..9aed10ce 100644 --- a/src/model/TransactionHistoryModel.cpp +++ b/src/model/TransactionHistoryModel.cpp @@ -75,7 +75,11 @@ QVariant TransactionHistoryModel::data(const QModelIndex &index, int role) const result = tInfo->fee(); break; case TransactionBlockHeightRole: - result = tInfo->blockHeight(); + // Use NULL QVariant for transactions without height. + // Forces them to be displayed at top when sorted by blockHeight. + if (tInfo->blockHeight() != 0) { + result = tInfo->blockHeight(); + } break; case TransactionHashRole: result = tInfo->hash(); -- cgit v1.2.3