mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-01 01:35:20 +00:00
fix unnecessary password request
This commit is contained in:
parent
00abc60cdc
commit
b2d66b2a6f
1 changed files with 7 additions and 4 deletions
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:
|
||||||
|
|
Loading…
Add table
Reference in a new issue