Skip to content

Commit 8c127ff

Browse files
committed
wallet: Skip key and script migration for blank wallets
Blank wallets don't have any keys or scripts to migrate
1 parent 4baa162 commit 8c127ff

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/wallet/wallet.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4246,8 +4246,11 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
42464246
// First change to using SQLite
42474247
if (!local_wallet->MigrateToSQLite(error)) return util::Error{error};
42484248

4249-
// Do the migration, and cleanup if it fails
4250-
success = DoMigration(*local_wallet, context, error, res);
4249+
// Do the migration of keys and scripts for non-blank wallets, and cleanup if it fails
4250+
success = local_wallet->IsWalletFlagSet(WALLET_FLAG_BLANK_WALLET);
4251+
if (!success) {
4252+
success = DoMigration(*local_wallet, context, error, res);
4253+
}
42514254
}
42524255

42534256
// In case of reloading failure, we need to remember the wallet dirs to remove

0 commit comments

Comments
 (0)