mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-29 16:31:29 +00:00
check password for all commands that require password
This commit is contained in:
parent
ed1fe71238
commit
889eb101ff
1 changed files with 4 additions and 4 deletions
|
@ -814,14 +814,14 @@ if __name__ == '__main__':
|
||||||
# commands needing password
|
# commands needing password
|
||||||
if cmd in ['payto', 'password', 'mktx', 'seed', 'import' ] or ( cmd=='addresses' and options.show_keys):
|
if cmd in ['payto', 'password', 'mktx', 'seed', 'import' ] or ( cmd=='addresses' and options.show_keys):
|
||||||
password = getpass.getpass('Password:') if wallet.use_encryption else None
|
password = getpass.getpass('Password:') if wallet.use_encryption else None
|
||||||
|
# check password
|
||||||
if cmd == 'import':
|
|
||||||
# decode seed in order to check password
|
|
||||||
try:
|
try:
|
||||||
seed = wallet.pw_decode( wallet.seed, password)
|
wallet.pw_decode( wallet.seed, password)
|
||||||
except:
|
except:
|
||||||
print "invalid password"
|
print "invalid password"
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
|
if cmd == 'import':
|
||||||
keypair = args[1]
|
keypair = args[1]
|
||||||
if wallet.import_key(keypair,password):
|
if wallet.import_key(keypair,password):
|
||||||
print "keypair imported"
|
print "keypair imported"
|
||||||
|
|
Loading…
Add table
Reference in a new issue