use userpw for encryption at sdl close
This commit is contained in:
@@ -276,7 +276,7 @@ void MainWindow::closeEvent(QCloseEvent* event) {
|
||||
fileoldencryption.remove();
|
||||
|
||||
// Encrypt our wallet.dat
|
||||
QString str = "123";///just for testing. We set the user pw here
|
||||
QString str = this->getPassword();
|
||||
// QString str = ed.txtPassword->text(); // data comes from user inputs
|
||||
int length = str.length();
|
||||
|
||||
@@ -351,6 +351,7 @@ void MainWindow::encryptWallet() {
|
||||
auto fnPasswordEdited = [=](const QString&) {
|
||||
// Enable the OK button if the passwords match.
|
||||
QString password = ed.txtPassword->text();
|
||||
this->setPassword(password);
|
||||
if (!ed.txtPassword->text().isEmpty() &&
|
||||
ed.txtPassword->text() == ed.txtConfirmPassword->text() && password.size() >= 16) {
|
||||
ed.lblPasswordMatch->setText("");
|
||||
@@ -546,6 +547,18 @@ void MainWindow::removeWalletEncryptionStartUp() {
|
||||
|
||||
}
|
||||
|
||||
QString MainWindow::getPassword()
|
||||
{
|
||||
|
||||
return _password;
|
||||
}
|
||||
|
||||
void MainWindow::setPassword(QString password)
|
||||
{
|
||||
|
||||
_password = password;
|
||||
}
|
||||
|
||||
void MainWindow::setupStatusBar() {
|
||||
// Status Bar
|
||||
loadingLabel = new QLabel();
|
||||
|
||||
@@ -51,6 +51,8 @@ public:
|
||||
QString doSendChatTxValidations(Tx tx);
|
||||
QString doSendRequestTxValidations(Tx tx);
|
||||
QString getCid();
|
||||
QString getPassword();
|
||||
void setPassword(QString Password);
|
||||
|
||||
void replaceWormholeClient(WormholeClient* newClient);
|
||||
bool isWebsocketListening();
|
||||
@@ -120,6 +122,7 @@ private:
|
||||
void setupStatusBar();
|
||||
|
||||
void clearSendForm();
|
||||
QString _password;
|
||||
|
||||
Tx createTxFromSendPage();
|
||||
bool confirmTx(Tx tx, RecurringPaymentInfo* rpi);
|
||||
|
||||
Reference in New Issue
Block a user