mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-05 10:42:13 +02:00
wallet: migration, avoid creating spendable wallet from a watch-only legacy wallet
Currently, the migration process creates a brand-new descriptor wallet with no connection to the user's legacy wallet when the legacy wallet lacks key material and contains only watch-only scripts. This behavior is not aligned with user expectations. If the legacy wallet contains only watch-only scripts, the migration process should only generate a watch-only wallet instead.
This commit is contained in:
@@ -468,7 +468,7 @@ void MigrateWalletActivity::migrate(const std::string& name)
|
||||
auto res{node().walletLoader().migrateWallet(name, passphrase)};
|
||||
|
||||
if (res) {
|
||||
m_success_message = tr("The wallet '%1' was migrated successfully.").arg(GUIUtil::HtmlEscape(GUIUtil::WalletDisplayName(res->wallet->getWalletName())));
|
||||
m_success_message = tr("The wallet '%1' was migrated successfully.").arg(GUIUtil::HtmlEscape(GUIUtil::WalletDisplayName(name)));
|
||||
if (res->watchonly_wallet_name) {
|
||||
m_success_message += QChar(' ') + tr("Watchonly scripts have been migrated to a new wallet named '%1'.").arg(GUIUtil::HtmlEscape(GUIUtil::WalletDisplayName(res->watchonly_wallet_name.value())));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user