File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -3862,7 +3862,11 @@ std::optional<MigrationData> CWallet::GetDescriptorsForLegacy(bilingual_str& err
38623862 AssertLockHeld (cs_wallet);
38633863
38643864 LegacyScriptPubKeyMan* legacy_spkm = GetLegacyScriptPubKeyMan ();
3865- assert (legacy_spkm);
3865+ if (!Assume (legacy_spkm)) {
3866+ // This shouldn't happen
3867+ error = Untranslated (STR_INTERNAL_BUG (" Error: Legacy wallet data missing" ));
3868+ return std::nullopt ;
3869+ }
38663870
38673871 std::optional<MigrationData> res = legacy_spkm->MigrateToDescriptor ();
38683872 if (res == std::nullopt ) {
@@ -3877,8 +3881,9 @@ bool CWallet::ApplyMigrationData(MigrationData& data, bilingual_str& error)
38773881 AssertLockHeld (cs_wallet);
38783882
38793883 LegacyScriptPubKeyMan* legacy_spkm = GetLegacyScriptPubKeyMan ();
3880- if (!legacy_spkm) {
3881- error = _ (" Error: This wallet is already a descriptor wallet" );
3884+ if (!Assume (legacy_spkm)) {
3885+ // This shouldn't happen
3886+ error = Untranslated (STR_INTERNAL_BUG (" Error: Legacy wallet data missing" ));
38823887 return false ;
38833888 }
38843889
You can’t perform that action at this time.
0 commit comments