aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2018-12-15 22:49:26 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2023-06-23 02:06:54 +0000
commit099dbe4224e0e896604e7f6901d0fc302b0bd3a0 (patch)
tree0d1133461350886e399c6920ec0d3d63b757510e /src
parent2d182f77cd8100395cf47a721bd01dc8620c9718 (diff)
GUI: TransactionRecord: When time/index/etc match, sort send before receive
Diffstat (limited to 'src')
-rw-r--r--src/qt/transactionrecord.cpp14
-rw-r--r--src/qt/transactiontablemodel.cpp3
2 files changed, 14 insertions, 3 deletions
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 85b7e70187..f08c0d17c3 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -154,11 +154,21 @@ void TransactionRecord::updateStatus(const interfaces::WalletTxStatus& wtx, cons
// Determine transaction status
// Sort order, unrecorded transactions sort to the top
- status.sortKey = strprintf("%010d-%01d-%010u-%03d",
+ int typesort;
+ switch (type) {
+ case SendToAddress: case SendToOther:
+ typesort = 2; break;
+ case RecvWithAddress: case RecvFromOther:
+ typesort = 3; break;
+ default:
+ typesort = 9;
+ }
+ status.sortKey = strprintf("%010d-%01d-%010u-%03d-%d",
wtx.block_height,
wtx.is_coinbase ? 1 : 0,
wtx.time_received,
- idx);
+ idx,
+ typesort);
status.countsForBalance = wtx.is_trusted && !(wtx.blocks_to_maturity > 0);
status.depth = wtx.depth_in_main_chain;
status.m_cur_block_hash = block_hash;
diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp
index c551456bda..8ae0a3c3ab 100644
--- a/src/qt/transactiontablemodel.cpp
+++ b/src/qt/transactiontablemodel.cpp
@@ -16,6 +16,7 @@
#include <core_io.h>
#include <interfaces/handler.h>
+#include <tinyformat.h>
#include <uint256.h>
#include <algorithm>
@@ -557,7 +558,7 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const
case Status:
return QString::fromStdString(rec->status.sortKey);
case Date:
- return rec->time;
+ return QString::fromStdString(strprintf("%020s-%s", rec->time, rec->status.sortKey));
case Type:
return formatTxType(rec);
case Watchonly: