mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-23 15:20:49 +01:00
wallet: Skip key and script migration for blank wallets
Blank wallets don't have any keys or scripts to migrate
This commit is contained in:
parent
4baa162dbb
commit
8c127ff1ed
1 changed files with 5 additions and 2 deletions
|
@ -4246,9 +4246,12 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
|
||||||
// First change to using SQLite
|
// First change to using SQLite
|
||||||
if (!local_wallet->MigrateToSQLite(error)) return util::Error{error};
|
if (!local_wallet->MigrateToSQLite(error)) return util::Error{error};
|
||||||
|
|
||||||
// Do the migration, and cleanup if it fails
|
// 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);
|
success = DoMigration(*local_wallet, context, error, res);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// In case of reloading failure, we need to remember the wallet dirs to remove
|
// In case of reloading failure, we need to remember the wallet dirs to remove
|
||||||
// Set is used as it may be populated with the same wallet directory paths multiple times,
|
// Set is used as it may be populated with the same wallet directory paths multiple times,
|
||||||
|
|
Loading…
Add table
Reference in a new issue