mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +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::UnlockContext ctx(walletModel->requestUnlock(false));
|
||||||
walletModel->getEncryptionStatus() == WalletModel::Locked){
|
if(!ctx.isValid())
|
||||||
|
{
|
||||||
WalletModel::UnlockContext ctx(walletModel->requestUnlock(false));
|
//unlock was cancelled
|
||||||
if(!ctx.isValid()){
|
darkSendPool.cachedNumBlocks = 0;
|
||||||
//unlock was cancelled
|
QMessageBox::warning(this, tr("Darksend"),
|
||||||
fEnableDarksend = false;
|
tr("Wallet is locked and user declined to unlock. Disabling Darksend."),
|
||||||
darkSendPool.cachedNumBlocks = 0;
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
LogPrintf("Wallet is locked and user declined to unlock. Disabling Darksend.\n");
|
if (fDebug) LogPrintf("Wallet is locked and user declined to unlock. Disabling Darksend.\n");
|
||||||
}
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user