aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2023-11-30 16:00:02 -0500
committerAva Chow <github@achow101.com>2024-01-11 15:49:51 -0500
commit8c127ff1edb6b9a607bf1ad247893347252a38e3 (patch)
tree828f603bf240b968d62edfb23a52b12c172ae40f /src/wallet/wallet.cpp
parent4baa162dbb3c6464e196a4a21fe63794859021b4 (diff)
downloadbitcoin-8c127ff1edb6b9a607bf1ad247893347252a38e3.tar.xz
wallet: Skip key and script migration for blank wallets
Blank wallets don't have any keys or scripts to migrate
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index bf8cfcb082..3cf4e9bdd1 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -4246,8 +4246,11 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
// First change to using SQLite
if (!local_wallet->MigrateToSQLite(error)) return util::Error{error};
- // Do the migration, and cleanup if it fails
- success = DoMigration(*local_wallet, context, error, res);
+ // Do the migration of keys and scripts for non-blank wallets, and cleanup if it fails
+ success = local_wallet->IsWalletFlagSet(WALLET_FLAG_BLANK_WALLET);
+ if (!success) {
+ success = DoMigration(*local_wallet, context, error, res);
+ }
}
// In case of reloading failure, we need to remember the wallet dirs to remove