mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Merge pull request #126 from UdjinM6/fix_ds_toggle_unlock
fix unlocking wallet on ds toggle event
This commit is contained in:
commit
8f88c50035
@ -450,20 +450,19 @@ void OverviewPage::toggleDarksend(){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if wallet is locked, ask for a passphrase
|
||||||
if (pwalletMain->GetBalance() - pwalletMain->GetAnonymizedBalance() > 2*COIN){
|
if (walletModel->getEncryptionStatus() == WalletModel::Locked)
|
||||||
if (walletModel->getEncryptionStatus() != WalletModel::Unencrypted){
|
{
|
||||||
if((nAnonymizeDarkcoinAmount*COIN)-pwalletMain->GetAnonymizedBalance() > 1.1*COIN &&
|
|
||||||
walletModel->getEncryptionStatus() == WalletModel::Locked){
|
|
||||||
|
|
||||||
WalletModel::UnlockContext ctx(walletModel->requestUnlock(false));
|
WalletModel::UnlockContext ctx(walletModel->requestUnlock(false));
|
||||||
if(!ctx.isValid()){
|
if(!ctx.isValid())
|
||||||
|
{
|
||||||
//unlock was cancelled
|
//unlock was cancelled
|
||||||
fEnableDarksend = false;
|
|
||||||
darkSendPool.cachedNumBlocks = 0;
|
darkSendPool.cachedNumBlocks = 0;
|
||||||
LogPrintf("Wallet is locked and user declined to unlock. Disabling Darksend.\n");
|
QMessageBox::warning(this, tr("Darksend"),
|
||||||
}
|
tr("Wallet is locked and user declined to unlock. Disabling Darksend."),
|
||||||
}
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
if (fDebug) LogPrintf("Wallet is locked and user declined to unlock. Disabling Darksend.\n");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user