mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-13 14:54:53 +02:00
wallet: Check for descriptors flag before migration
Previously we would check that there is no LegacySPKM in order to determine whether a wallet is already a descriptor wallet and doesn't need to be migrated. However blank legacy wallets will also not have a LegacySPKM, so we need to be checking for the descriptors flag instead.
This commit is contained in:
@ -4213,7 +4213,7 @@ util::Result<MigrationResult> MigrateLegacyToDescriptor(const std::string& walle
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Before anything else, check if there is something to migrate.
|
// Before anything else, check if there is something to migrate.
|
||||||
if (!local_wallet->GetLegacyScriptPubKeyMan()) {
|
if (local_wallet->IsWalletFlagSet(WALLET_FLAG_DESCRIPTORS)) {
|
||||||
return util::Error{_("Error: This wallet is already a descriptor wallet")};
|
return util::Error{_("Error: This wallet is already a descriptor wallet")};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user