| 3918 | } |
| 3919 | |
| 3920 | std::optional<MigrationData> CWallet::GetDescriptorsForLegacy(bilingual_str& error) const |
| 3921 | { |
| 3922 | AssertLockHeld(cs_wallet); |
| 3923 | |
| 3924 | LegacyDataSPKM* legacy_spkm = GetLegacyDataSPKM(); |
| 3925 | if (!Assume(legacy_spkm)) { |
| 3926 | // This shouldn't happen |
| 3927 | error = Untranslated(STR_INTERNAL_BUG("Error: Legacy wallet data missing")); |
| 3928 | return std::nullopt; |
| 3929 | } |
| 3930 | |
| 3931 | std::optional<MigrationData> res = legacy_spkm->MigrateToDescriptor(); |
| 3932 | if (res == std::nullopt) { |
| 3933 | error = _("Error: Unable to produce descriptors for this legacy wallet. Make sure to provide the wallet's passphrase if it is encrypted."); |
| 3934 | return std::nullopt; |
| 3935 | } |
| 3936 | return res; |
| 3937 | } |
| 3938 | |
| 3939 | util::Result<void> CWallet::ApplyMigrationData(WalletBatch& local_wallet_batch, MigrationData& data) |
| 3940 | { |
no test coverage detected