From 0702338912ec9074e3532e85c43479fe06eb4970 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Sat, 31 Aug 2019 08:32:06 +0200 Subject: [PATCH] main script: rm init_daemon (dead code), call sys_exit in init_cmdline --- run_electrum | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/run_electrum b/run_electrum index 8647552a3..3f0df3339 100755 --- a/run_electrum +++ b/run_electrum @@ -106,29 +106,6 @@ def prompt_password(prompt, confirm=True): return password -def init_daemon(config_options): - config = SimpleConfig(config_options) - storage = WalletStorage(config.get_wallet_path()) - if not storage.file_exists(): - print_msg("Error: Wallet file not found.") - print_msg("Type 'electrum create' to create a new wallet, or provide a path to a wallet with the -w option") - sys.exit(0) - if storage.is_encrypted(): - if storage.is_encrypted_with_hw_device(): - plugins = init_plugins(config, 'cmdline') - password = get_password_for_hw_device_encrypted_storage(plugins) - elif config.get('password'): - password = config.get('password') - else: - password = prompt_password('Password:', False) - if not password: - print_msg("Error: Password required") - sys.exit(1) - else: - password = None - config_options['password'] = password - - def init_cmdline(config_options, server): config = SimpleConfig(config_options) cmdname = config.get('cmd') @@ -150,7 +127,7 @@ def init_cmdline(config_options, server): if cmd.requires_wallet and not storage.file_exists(): print_msg("Error: Wallet file not found.") print_msg("Type 'electrum create' to create a new wallet, or provide a path to a wallet with the -w option") - sys.exit(0) + sys_exit(1) # important warning if cmd.name in ['getprivatekeys']: @@ -171,7 +148,7 @@ def init_cmdline(config_options, server): password = prompt_password('Password:', False) if not password: print_msg("Error: Password required") - sys.exit(1) + sys_exit(1) else: password = None