Skip to content

Commit

Permalink
fix unlock for staking
Browse files Browse the repository at this point in the history
this fixes issue #42
  • Loading branch information
flo071 committed Apr 7, 2020
1 parent 50bfa5a commit 6e9f34a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/qt/askpassphrasedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ AskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent, QLabel *isS
ui->passLabel3->hide();
ui->passEdit3->hide();
ui->unlockForStakingOnlyCheckBox->show();
ui->unlockForStakingOnlyCheckBox->setChecked(true);
ui->unlockForStakingOnlyLabel->show();
setWindowTitle(tr("Unlock wallet"));
break;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void WalletFrame::unlockForStaking()
{
WalletView *walletView = currentWalletView();
if (walletView)
walletView->unlockWallet(true);
walletView->unlockWallet(true, true);
}

void WalletFrame::lockWallet()
Expand Down
4 changes: 2 additions & 2 deletions src/qt/walletview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,15 +422,15 @@ void WalletView::changePassphrase()
dlg.exec();
}

void WalletView::unlockWallet(bool iconClicked)
void WalletView::unlockWallet(bool iconClicked, bool fStaking)
{
if(!walletModel)
return;
// Unlock wallet when requested by wallet model
if (walletModel->getEncryptionStatus() == WalletModel::Locked
|| (!iconClicked && walletModel->getEncryptionStatus() == WalletModel::UnlockedForStaking))
{
AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
AskPassphraseDialog dlg(fStaking ? AskPassphraseDialog::UnlockManual : AskPassphraseDialog::Unlock, this);
dlg.setModel(walletModel);
dlg.exec();
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/walletview.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public Q_SLOTS:
/** Change encrypted wallet passphrase */
void changePassphrase();
/** Ask for passphrase to unlock wallet temporarily */
void unlockWallet(bool iconClicked=false);
void unlockWallet(bool iconClicked=false, bool fStaking = false);
/** lock wallet */
void lockWallet();

Expand Down

0 comments on commit 6e9f34a

Please sign in to comment.