Browse Source

fix: exit if no password is provided when needed

master
thomasv 13 years ago
parent
commit
accbf7ea82
  1. 20
      electrum

20
electrum

@ -378,13 +378,19 @@ if __name__ == '__main__':
# commands needing password # commands needing password
if cmd in protected_commands or ( cmd=='addresses' and options.show_keys): if cmd in protected_commands or ( cmd=='addresses' and options.show_keys):
password = prompt_password('Password:', False) if wallet.use_encryption and not is_temporary else None if wallet.use_encryption and not is_temporary:
# check password password = prompt_password('Password:', False)
try: if not password:
wallet.pw_decode( wallet.seed, password) print_msg("Error: Password required")
except: exit(1)
print_msg("Error: This password does not decode this wallet.") # check password
exit(1) try:
wallet.pw_decode( wallet.seed, password)
except:
print_msg("Error: This password does not decode this wallet.")
exit(1)
else:
password = None
if cmd == 'import': if cmd == 'import':
# See if they specificed a key on the cmd line, if not prompt # See if they specificed a key on the cmd line, if not prompt

Loading…
Cancel
Save