From f54c20617cc139658273db641fd3e6ae6d219397 Mon Sep 17 00:00:00 2001 From: furszy Date: Tue, 22 Dec 2020 01:37:58 -0300 Subject: [PATCH] [GUI] Finally, fix duplicate records. --- src/qt/transactionrecord.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index acc6ec0774c0..a9be40d74252 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -343,7 +343,7 @@ bool TransactionRecord::decomposeDebitTransaction(const CWallet* wallet, const C } // Decompose shielded debit - return decomposeShieldedDebitTransaction(wallet, wtx, nTxFee, involvesWatchAddress, parts); + return decomposeShieldedDebitTransaction(wallet, wtx, nTxFee, involvesWatchAddress, parts) || !parts.empty(); } // Check whether all the shielded inputs and outputs are from and send to this wallet @@ -445,10 +445,14 @@ QList TransactionRecord::decomposeTransaction(const CWallet* } } - // if we get to this point, we have a mixed debit transaction, can't break down payees. - TransactionRecord record(wtx.GetHash(), wtx.GetTxTime(), wtx.GetTotalSize(), TransactionRecord::Other, "", nNet, 0); - record.involvesWatchAddress = involvesWatchAddress; - parts.append(record); + // Check if wasn't able to decompose the transaction + if (parts.empty()) { + // if we get to this point, we have a mixed debit transaction, can't break down payees. + TransactionRecord record(wtx.GetHash(), wtx.GetTxTime(), wtx.GetTotalSize(), TransactionRecord::Other, "", nNet, + 0); + record.involvesWatchAddress = involvesWatchAddress; + parts.append(record); + } return parts; }