gui: Show an error message if the restored wallet name is empty
What changed, and why it matters
This is a minor user-interface improvement, not a security fix. The Bitcoin Core wallet restore dialog used to silently do nothing when a user left the wallet name blank. Now it shows a clear error message explaining that the wallet name cannot be empty. There is no vulnerability here.
No security action needed. Treat as a normal UX fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change splits a single guard clause into two. Previously, both cancelling the dialog and entering an empty wallet name caused a silent return. Now, cancellation still returns silently, while an empty name triggers a QMessageBox::critical popup with translated error text. The underlying validation behavior is unchanged; only the user feedback is improved.
Changed components
src/qt/bitcoingui.cppRestore Wallet dialog (GUI only)Inspect captured patch +5 / −1
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index dc4a8271..41ef2996 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -452,7 +452,11 @@ void BitcoinGUI::createActions()
//: Label of the input field where the name of the wallet is entered.
QString label = tr("Wallet Name");
QString wallet_name = QInputDialog::getText(this, title, label, QLineEdit::Normal, "", &wallet_name_ok);
- if (!wallet_name_ok || wallet_name.isEmpty()) return;
+ if (!wallet_name_ok) return;
+ if (wallet_name.isEmpty()) {
+ QMessageBox::critical(nullptr, tr("Invalid Wallet Name"), tr("Wallet name cannot be empty"));
+ return;
+ }
auto activity = new RestoreWalletActivity(m_wallet_controller, this);
connect(activity, &RestoreWalletActivity::restored, this, &BitcoinGUI::setCurrentWallet, Qt::QueuedConnection);
Why this scored 15/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.