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)
3843
3843
3844
3844
// Close this database and delete the file
3845
3845
fs::path db_path = fs::PathFromString (m_database->Filename ());
3846
- fs::path db_dir = db_path.parent_path ();
3847
3846
m_database->Close ();
3848
3847
fs::remove (db_path);
3849
3848
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
+
3850
3853
// Make new DB
3851
3854
DatabaseOptions opts;
3852
3855
opts.require_create = true ;
3853
3856
opts.require_format = DatabaseFormat::SQLITE;
3854
3857
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);
3856
3859
assert (new_db); // This is to prevent doing anything further with this wallet. The original file was deleted, but a backup exists.
3857
3860
m_database.reset ();
3858
3861
m_database = std::move (new_db);
You can’t perform that action at this time.
0 commit comments