fix #2257
This commit is contained in:
@@ -154,18 +154,13 @@ class ElectrumGui:
|
|||||||
w.bring_to_top()
|
w.bring_to_top()
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
wallet = self.daemon.get_wallet(path)
|
wallet = self.daemon.load_wallet(path, None)
|
||||||
if not wallet:
|
if not wallet:
|
||||||
storage = WalletStorage(path)
|
storage = WalletStorage(path)
|
||||||
if not storage.file_exists() or storage.is_encrypted():
|
wizard = InstallWizard(self.config, self.app, self.plugins, storage)
|
||||||
wizard = InstallWizard(self.config, self.app, self.plugins, storage)
|
wallet = wizard.run_and_get_wallet()
|
||||||
wallet = wizard.run_and_get_wallet()
|
if not wallet:
|
||||||
if not wallet:
|
return
|
||||||
return
|
|
||||||
else:
|
|
||||||
wallet = Wallet(storage)
|
|
||||||
wallet.start_threads(self.daemon.network)
|
|
||||||
self.daemon.add_wallet(wallet)
|
|
||||||
w = self.create_window_for_wallet(wallet)
|
w = self.create_window_for_wallet(wallet)
|
||||||
if uri:
|
if uri:
|
||||||
w.pay_to_URI(uri)
|
w.pay_to_URI(uri)
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ class Daemon(DaemonThread):
|
|||||||
response = "Daemon already running"
|
response = "Daemon already running"
|
||||||
elif sub == 'load_wallet':
|
elif sub == 'load_wallet':
|
||||||
path = config.get_wallet_path()
|
path = config.get_wallet_path()
|
||||||
self.load_wallet(path, lambda: config.get('password'))
|
self.load_wallet(path, config.get('password'))
|
||||||
response = True
|
response = True
|
||||||
elif sub == 'close_wallet':
|
elif sub == 'close_wallet':
|
||||||
path = config.get_wallet_path()
|
path = config.get_wallet_path()
|
||||||
@@ -198,7 +198,7 @@ class Daemon(DaemonThread):
|
|||||||
response = "Error: Electrum is running in daemon mode. Please stop the daemon first."
|
response = "Error: Electrum is running in daemon mode. Please stop the daemon first."
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def load_wallet(self, path, password_getter):
|
def load_wallet(self, path, password):
|
||||||
# wizard will be launched if we return
|
# wizard will be launched if we return
|
||||||
if path in self.wallets:
|
if path in self.wallets:
|
||||||
wallet = self.wallets[path]
|
wallet = self.wallets[path]
|
||||||
@@ -207,9 +207,8 @@ class Daemon(DaemonThread):
|
|||||||
if not storage.file_exists():
|
if not storage.file_exists():
|
||||||
return
|
return
|
||||||
if storage.is_encrypted():
|
if storage.is_encrypted():
|
||||||
password = password_getter()
|
|
||||||
if not password:
|
if not password:
|
||||||
raise UserCancelled()
|
return
|
||||||
storage.decrypt(password)
|
storage.decrypt(password)
|
||||||
if storage.requires_split():
|
if storage.requires_split():
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user