diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index 524401b98..ebf7b7509 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -669,7 +669,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): self.recently_visited_menu.setEnabled(bool(len(recent))) def get_wallet_folder(self): - return os.path.dirname(os.path.abspath(self.wallet.storage.path)) + return os.path.abspath(self.config.get_datadir_wallet_path()) def new_wallet(self): try: diff --git a/electrum/simple_config.py b/electrum/simple_config.py index 5f9d462bd..c803f0de2 100644 --- a/electrum/simple_config.py +++ b/electrum/simple_config.py @@ -445,6 +445,7 @@ class SimpleConfig(Logger): new_path = self.get_fallback_wallet_path() + # TODO: this can be removed by now # default path in pre 1.9 versions old_path = os.path.join(self.path, "electrum.dat") if os.path.exists(old_path) and not os.path.exists(new_path): @@ -452,12 +453,14 @@ class SimpleConfig(Logger): return new_path - def get_fallback_wallet_path(self): + def get_datadir_wallet_path(self): util.assert_datadir_available(self.path) dirpath = os.path.join(self.path, "wallets") make_dir(dirpath, allow_symlink=False) - path = os.path.join(self.path, "wallets", "default_wallet") - return path + return dirpath + + def get_fallback_wallet_path(self): + return os.path.join(self.get_datadir_wallet_path(), "default_wallet") def remove_from_recently_open(self, filename): recent = self.RECENTLY_OPEN_WALLET_FILES or []