Browse Source

use userpw for encryption at sdl close

pull/130/head
DenioD 4 years ago
parent
commit
c12a4ffe73
  1. 15
      src/mainwindow.cpp
  2. 3
      src/mainwindow.h

15
src/mainwindow.cpp

@ -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();

3
src/mainwindow.h

@ -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);

Loading…
Cancel
Save