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
3862
3862
AssertLockHeld (cs_wallet);
3863
3863
3864
3864
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
+ }
3866
3870
3867
3871
std::optional<MigrationData> res = legacy_spkm->MigrateToDescriptor ();
3868
3872
if (res == std::nullopt) {
@@ -3877,8 +3881,9 @@ bool CWallet::ApplyMigrationData(MigrationData& data, bilingual_str& error)
3877
3881
AssertLockHeld (cs_wallet);
3878
3882
3879
3883
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" ));
3882
3887
return false ;
3883
3888
}
3884
3889
You can’t perform that action at this time.
0 commit comments