File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3843,16 +3843,19 @@ bool CWallet::MigrateToSQLite(bilingual_str& error)
38433843
38443844 // Close this database and delete the file
38453845 fs::path db_path = fs::PathFromString (m_database->Filename ());
3846- fs::path db_dir = db_path.parent_path ();
38473846 m_database->Close ();
38483847 fs::remove (db_path);
38493848
3849+ // Generate the path for the location of the migrated wallet
3850+ // Wallets that are plain files rather than wallet directories will be migrated to be wallet directories.
3851+ const fs::path wallet_path = fsbridge::AbsPathJoin (GetWalletDir (), fs::PathFromString (m_name));
3852+
38503853 // Make new DB
38513854 DatabaseOptions opts;
38523855 opts.require_create = true ;
38533856 opts.require_format = DatabaseFormat::SQLITE;
38543857 DatabaseStatus db_status;
3855- std::unique_ptr<WalletDatabase> new_db = MakeDatabase (db_dir , opts, db_status, error);
3858+ std::unique_ptr<WalletDatabase> new_db = MakeDatabase (wallet_path , opts, db_status, error);
38563859 assert (new_db); // This is to prevent doing anything further with this wallet. The original file was deleted, but a backup exists.
38573860 m_database.reset ();
38583861 m_database = std::move (new_db);
You can’t perform that action at this time.
0 commit comments