fix: check_password for imported wallets
This commit is contained in:
parent
84fc4574d6
commit
576954555c
8
electrum
8
electrum
@ -349,23 +349,19 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
# commands needing password
|
# commands needing password
|
||||||
if cmd.requires_password:
|
if cmd.requires_password:
|
||||||
if wallet.seed == '':
|
if wallet.use_encryption:
|
||||||
seed = ''
|
|
||||||
password = None
|
|
||||||
elif wallet.use_encryption:
|
|
||||||
password = prompt_password('Password:', False)
|
password = prompt_password('Password:', False)
|
||||||
if not password:
|
if not password:
|
||||||
print_msg("Error: Password required")
|
print_msg("Error: Password required")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
# check password
|
# check password
|
||||||
try:
|
try:
|
||||||
seed = wallet.get_seed(password)
|
seed = wallet.check_password(password)
|
||||||
except InvalidPassword:
|
except InvalidPassword:
|
||||||
print_msg("Error: This password does not decode this wallet.")
|
print_msg("Error: This password does not decode this wallet.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
password = None
|
password = None
|
||||||
seed = wallet.get_seed(None)
|
|
||||||
else:
|
else:
|
||||||
password = None
|
password = None
|
||||||
|
|
||||||
|
|||||||
@ -2320,7 +2320,7 @@ class ElectrumWindow(QMainWindow):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
mnemonic = self.wallet.get_mnemonic(password)
|
self.wallet.check_password(password)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
QMessageBox.warning(self, _('Error'), str(e), _('OK'))
|
QMessageBox.warning(self, _('Error'), str(e), _('OK'))
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user