Check for empty password and cancellation in JoinMarket-Qt wallet generation

This commit is contained in:
Kristaps Kaupe 2018-12-20 21:08:43 +02:00
parent 90607ed961
commit 5d66d9410f

View file

@ -1464,13 +1464,21 @@ class JMMainWindow(QMainWindow):
def getPassword(self):
pd = PasswordDialog()
while True:
pd.exec_()
if pd.new_pw.text() != pd.conf_pw.text():
pd_return = pd.exec_()
if pd_return == QDialog.Rejected:
return None
elif pd.new_pw.text() != pd.conf_pw.text():
JMQtMessageBox(self,
"Passwords don't match.",
mbtype='warn',
title="Error")
continue
elif pd.new_pw.text() == "":
JMQtMessageBox(self,
"Password must not be empty.",
mbtype='warn',
title="Error")
continue
break
self.textpassword = str(pd.new_pw.text())
return self.textpassword.encode('utf-8')