TransactionHistoryModel: only place pending tx first
What changed, and why it matters
This commit fixes a display bug in the Monero GUI wallet's transaction history list. Previously, failed transactions were being shown at the top of the list alongside pending transactions, because any transaction without a confirmed block height was treated as 'top priority.' Now only genuinely pending transactions are promoted to the top; failed transactions are sorted by their actual (zero) block height instead. There is no direct security risk such as theft, code execution, or data loss.
No urgent security action required. Treat as a normal bug-fix release. If auditing, verify that isPending() and isFailed() are mutually exclusive with confirmed states elsewhere in the model, but the change itself is low risk.
Security signals we found
UI presentation bug, not a memory-safety or cryptographic issue
No attacker-controlled input parsing changed
No privilege escalation, authentication, or authorization logic modified
No external network or IPC behavior changed
Evidence from the diff
In TransactionHistoryModel::parseTransactionInfo, the TransactionBlockHeightRole previously returned a null QVariant whenever blockHeight() == 0, causing the view’s sort proxy to push all zero-height transactions to the top. The change narrows that behavior to transactions where blockHeight() == 0 AND isPending() AND !isFailed(). Failed transactions now return 0 instead of QVariant(), so they no longer float to the top. This is a UI/UX correctness fix with no cryptographic, network, or privilege-boundary implications evident in the diff.
Changed components
src/model/TransactionHistoryModel.cppMonero GUI transaction history view sortingInspect captured patch +6 / −5
### src/model/TransactionHistoryModel.cpp
@@ -79,13 +79,14 @@ QVariant TransactionHistoryModel::parseTransactionInfo(const TransactionInfo &tI
return tInfo.fee();
case TransactionBlockHeightRole:
{
- // Use NULL QVariant for transactions without height.
- // Forces them to be displayed at top when sorted by blockHeight.
- if (tInfo.blockHeight() != 0)
+ // Use NULL QVariant for pending transactions without height.
+ // Forces them to be displayed at top when sorted by blockHeight,
+ // without also promoting failed transactions.
+ if (tInfo.blockHeight() == 0 && tInfo.isPending() && !tInfo.isFailed())
{
- return tInfo.blockHeight();
+ return QVariant();
}
- return QVariant();
+ return tInfo.blockHeight();
}
case TransactionSubaddrIndexRole:
{Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.