Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/qt/transactiontablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@ class TransactionTablePriv

// First check if the amount of txs exceeds the UI limit
if (txesSize > MAX_AMOUNT_LOADED_RECORDS) {
// Sort the txs by date just to be really really sure that them are ordered.
// (this extra calculation should be removed in the future if can ensure that
// txs are stored in order in the db, which is what should be happening)
// Sort the txs by date
sort(walletTxes.begin(), walletTxes.end(),
[](const CWalletTx & a, const CWalletTx & b) -> bool {
return a.GetTxTime() > b.GetTxTime();
Expand Down Expand Up @@ -153,6 +151,10 @@ class TransactionTablePriv
nFirstLoadedTxTime = convertRes.nFirstLoadedTxTime;
}
}

// Now that all records have been cached, sort them by tx hash
std::sort(cachedWallet.begin(), cachedWallet.end(), TxLessThan());

} else {
// Single thread flow
ConvertTxToVectorResult convertRes = convertTxToRecords(wallet, walletTxes);
Expand Down