Wallet: clear tmpTxDescription in sweepOutputs
What changed, and why it matters
This fix corrects a bug in Feather Wallet's 'sweep outputs' feature. When a user swept funds (moved specific outputs), the wallet accidentally reused the payment description/memo from the previous regular transaction. This could mislead the user into confirming a transaction with the wrong description attached, and the incorrect description would be recorded in the transaction history. It is a UI/state bug rather than a code-execution vulnerability.
Apply the patch. After patching, verify that sweepOutputs clears the transaction description field in the confirmation dialog and that no description from a prior transaction is carried over. Consider adding a regression test for description state reset across transaction-building methods.
Security signals we found
State variable not reset between operations (stale tmpTxDescription)
UI confirmation dialog may display stale/misleading transaction description
Transaction metadata (description) may be incorrectly committed to wallet history
Fix mirrors existing pattern in createTransaction/createTransactionMultiDest
Fixes reported issue #299
Evidence from the diff
In src/libwalletqt/Wallet.cpp, the sweepOutputs() method did not clear this->tmpTxDescription before constructing a transaction. createTransaction() and createTransactionMultiDest() already reset this field, but sweepOutputs() did not. As a result, the description from the most recent regular transaction persisted into the sweep transaction’s confirmation dialog and commit path. The patch adds this->tmpTxDescription = “”; at the start of sweepOutputs(), mirroring the other transaction-building methods.
Changed components
src/libwalletqt/Wallet.cppWallet::sweepOutputs()Transaction description / memo handlingInspect captured patch +2 / −0
diff --git a/src/libwalletqt/Wallet.cpp b/src/libwalletqt/Wallet.cpp
index c26e40d..179e96e 100644
--- a/src/libwalletqt/Wallet.cpp
+++ b/src/libwalletqt/Wallet.cpp
@@ -929,6 +929,8 @@ void Wallet::createTransactionMultiDest(const QVector<QString> &addresses, const
}
void Wallet::sweepOutputs(const QVector<QString> &keyImages, QString address, bool churn, int outputs, int feeLevel) {
+ this->tmpTxDescription = "";
+
if (churn) {
address = this->address(m_currentSubaddressAccount, 0);
}
Why this scored 34/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.