gui: remove AmountWithFeeExceedsBalance error special case
What changed, and why it matters
This commit removes a special error message in the Bitcoin Core graphical wallet that told users when their balance was too small to cover both the payment amount and the transaction fee. The wallet now lets an underlying internal function produce the error message instead. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be a code cleanup and user-experience simplification.
No immediate security action required. Treat as routine maintenance. If reviewing, verify that PR #34299's error messages adequately replace the removed special-case message and that users still receive a clear explanation when funds are insufficient to cover amount plus fee.
Security signals we found
No security-relevant keywords in commit title or message
Change is a deletion/simplification of GUI error handling
No input validation, cryptography, or consensus logic modified
No bounds checks, memory allocations, or permission changes present
References internal refactor PR #34299
Evidence from the diff
The change deletes the AmountWithFeeExceedsBalance enum value and the corresponding GUI handling. Previously, when prepareTransaction failed to create a transaction and the amount plus fee exceeded the balance, it returned a distinct status so the GUI could show a tailored message. After PR #34299, the wallet’s internal transaction creation path already returns a localized error string, so the special case is redundant. The code now emits the wallet’s own error message and returns TransactionCreationFailed for any failure to create a transaction.
Changed components
src/qt/sendcoinsdialog.cppsrc/qt/walletmodel.cppsrc/qt/walletmodel.hInspect captured patch +1 / −10
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp
index c475c6b7..90e46c79 100644
--- a/src/qt/sendcoinsdialog.cpp
+++ b/src/qt/sendcoinsdialog.cpp
@@ -742,9 +742,6 @@ void SendCoinsDialog::processSendCoinsReturn(const WalletModel::SendCoinsReturn
case WalletModel::AmountExceedsBalance:
msgParams.first = tr("The amount exceeds your balance.");
break;
- case WalletModel::AmountWithFeeExceedsBalance:
- msgParams.first = tr("The total exceeds your balance when the %1 transaction fee is included.").arg(msgArg);
- break;
case WalletModel::DuplicateAddress:
msgParams.first = tr("Duplicate address found: addresses should only be used once each.");
break;
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 578713c0..2880c6e7 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -209,12 +209,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
if (fSubtractFeeFromAmount && newTx)
transaction.reassignAmounts(nChangePosRet);
- if(!newTx)
- {
- if(!fSubtractFeeFromAmount && (total + nFeeRequired) > nBalance)
- {
- return SendCoinsReturn(AmountWithFeeExceedsBalance);
- }
+ if (!newTx) {
Q_EMIT message(tr("Send Coins"), QString::fromStdString(util::ErrorString(res).translated),
CClientUIInterface::MSG_ERROR);
return TransactionCreationFailed;
diff --git a/src/qt/walletmodel.h b/src/qt/walletmodel.h
index c4abde8b..ced05757 100644
--- a/src/qt/walletmodel.h
+++ b/src/qt/walletmodel.h
@@ -59,7 +59,6 @@ public:
InvalidAmount,
InvalidAddress,
AmountExceedsBalance,
- AmountWithFeeExceedsBalance,
DuplicateAddress,
TransactionCreationFailed, // Error returned when wallet is still locked
AbsurdFee
Why this scored 20/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.