Replace config GUI_LAST_WALLET with CURRENT_WALLET
- CURRENT_WALLET is set when a single wallet is loaded in memory, and it remains set after Electrum stops running. - If several wallets are loaded at the same time, CURRENT_WALLET is unset, and RPCs must specify the wallet explicitly (using --wallet for the CLI) - The fallback to 'default_wallet' essentially only applies when creating a new wallet file
This commit is contained in:
@@ -178,7 +178,7 @@ class QEDaemon(AuthMixin, QObject):
|
||||
if path is None:
|
||||
self._path = self.daemon.config.get('wallet_path') # command line -w option
|
||||
if self._path is None:
|
||||
self._path = self.daemon.config.GUI_LAST_WALLET
|
||||
self._path = self.daemon.config.CURRENT_WALLET
|
||||
else:
|
||||
self._path = path
|
||||
if self._path is None:
|
||||
|
||||
@@ -488,9 +488,6 @@ class ElectrumGui(BaseElectrumGui, Logger):
|
||||
if window in self.windows:
|
||||
self.windows.remove(window)
|
||||
self.build_tray_menu()
|
||||
# save wallet path of last open window
|
||||
if not self.windows:
|
||||
self.config.save_last_wallet(window.wallet)
|
||||
run_hook('on_close_window', window)
|
||||
if window.should_stop_wallet_on_close:
|
||||
self.daemon.stop_wallet(window.wallet.storage.path)
|
||||
@@ -555,7 +552,7 @@ class ElectrumGui(BaseElectrumGui, Logger):
|
||||
return
|
||||
# start wizard to select/create wallet
|
||||
self.timer.start()
|
||||
path = self.config.get_wallet_path(use_gui_last_wallet=True)
|
||||
path = self.config.get_wallet_path()
|
||||
try:
|
||||
if not self.start_new_window(path, self.config.get('url'), app_is_starting=True):
|
||||
return
|
||||
|
||||
@@ -26,7 +26,7 @@ class ElectrumGui(BaseElectrumGui, EventListener):
|
||||
def __init__(self, *, config, daemon, plugins):
|
||||
BaseElectrumGui.__init__(self, config=config, daemon=daemon, plugins=plugins)
|
||||
self.network = daemon.network
|
||||
storage = WalletStorage(config.get_wallet_path(use_gui_last_wallet=True))
|
||||
storage = WalletStorage(config.get_wallet_path())
|
||||
if not storage.file_exists():
|
||||
print("Wallet not found. try 'electrum create'")
|
||||
exit()
|
||||
|
||||
@@ -62,7 +62,7 @@ class ElectrumGui(BaseElectrumGui, EventListener):
|
||||
def __init__(self, *, config: 'SimpleConfig', daemon: 'Daemon', plugins: 'Plugins'):
|
||||
BaseElectrumGui.__init__(self, config=config, daemon=daemon, plugins=plugins)
|
||||
self.network = daemon.network
|
||||
storage = WalletStorage(config.get_wallet_path(use_gui_last_wallet=True))
|
||||
storage = WalletStorage(config.get_wallet_path())
|
||||
password = None
|
||||
if not storage.file_exists():
|
||||
print("Wallet not found. try 'electrum create'")
|
||||
@@ -70,7 +70,7 @@ class ElectrumGui(BaseElectrumGui, EventListener):
|
||||
if storage.is_encrypted():
|
||||
password = getpass.getpass('Password:', stream=None)
|
||||
del storage
|
||||
self.wallet = self.daemon.load_wallet(config.get_wallet_path(use_gui_last_wallet=True), password)
|
||||
self.wallet = self.daemon.load_wallet(config.get_wallet_path(), password)
|
||||
self.contacts = self.wallet.contacts
|
||||
|
||||
locale.setlocale(locale.LC_ALL, '')
|
||||
|
||||
Reference in New Issue
Block a user