aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionrecord.cpp
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/qt/transactionrecord.cpp
parent2d182f77cd8100395cf47a721bd01dc8620c9718 (diff)
GUI: TransactionRecord: When time/index/etc match, sort send before receive
Diffstat (limited to 'src/qt/transactionrecord.cpp')
-rw-r--r--src/qt/transactionrecord.cpp14
1 files changed, 12 insertions, 2 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;