fix unnecessary password request
This commit is contained in:
11
electrum
11
electrum
@@ -236,7 +236,7 @@ def init_cmdline(config_options, server):
|
|||||||
if not storage.is_encrypted():
|
if not storage.is_encrypted():
|
||||||
storage.read(None)
|
storage.read(None)
|
||||||
# commands needing password
|
# commands needing password
|
||||||
if (storage.is_encrypted() and server is None)\
|
if (cmd.requires_wallet and storage.is_encrypted() and server is None)\
|
||||||
or (cmd.requires_password and (storage.get('use_encryption') or storage.is_encrypted())):
|
or (cmd.requires_password and (storage.get('use_encryption') or storage.is_encrypted())):
|
||||||
if config.get('password'):
|
if config.get('password'):
|
||||||
password = config.get('password')
|
password = config.get('password')
|
||||||
@@ -261,9 +261,12 @@ def run_offline_command(config, config_options):
|
|||||||
cmdname = config.get('cmd')
|
cmdname = config.get('cmd')
|
||||||
cmd = known_commands[cmdname]
|
cmd = known_commands[cmdname]
|
||||||
password = config_options.get('password')
|
password = config_options.get('password')
|
||||||
storage = WalletStorage(config.get_wallet_path())
|
if cmd.requires_wallet:
|
||||||
storage.read(password if storage.is_encrypted() else None)
|
storage = WalletStorage(config.get_wallet_path())
|
||||||
wallet = Wallet(storage) if cmd.requires_wallet else None
|
storage.read(password if storage.is_encrypted() else None)
|
||||||
|
wallet = Wallet(storage)
|
||||||
|
else:
|
||||||
|
wallet = None
|
||||||
# check password
|
# check password
|
||||||
if cmd.requires_password and storage.get('use_encryption'):
|
if cmd.requires_password and storage.get('use_encryption'):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user