commit 420b1a66362bf9b3965afbb58953eaf41c3c06f3
parent 3d88d6870cf509632d2cdcfd8beabd973a8c363f
Author: SomberNight <somber.night@protonmail.com>
Date: Fri, 22 Nov 2019 15:54:34 +0100
cli: load_wallet now auto-upgrades the WalletStorage when needed
previously it would bail out and just return False
Diffstat:
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/electrum/commands.py b/electrum/commands.py
@@ -199,7 +199,7 @@ class Commands:
@command('n')
async def load_wallet(self, wallet_path=None, password=None):
"""Open wallet in daemon"""
- wallet = self.daemon.load_wallet(wallet_path, password)
+ wallet = self.daemon.load_wallet(wallet_path, password, manual_upgrades=False)
if wallet is not None:
run_hook('load_wallet', wallet, None)
response = wallet is not None
diff --git a/electrum/daemon.py b/electrum/daemon.py
@@ -376,13 +376,13 @@ class Daemon(Logger):
response = "Error: Electrum is running in daemon mode. Please stop the daemon first."
return response
- def load_wallet(self, path, password) -> Optional[Abstract_Wallet]:
+ def load_wallet(self, path, password, *, manual_upgrades=True) -> Optional[Abstract_Wallet]:
path = standardize_path(path)
# wizard will be launched if we return
if path in self._wallets:
wallet = self._wallets[path]
return wallet
- storage = WalletStorage(path, manual_upgrades=True)
+ storage = WalletStorage(path, manual_upgrades=manual_upgrades)
if not storage.file_exists():
return
if storage.is_encrypted():