mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +01:00
fixed locking bug
This commit is contained in:
parent
58da56cea3
commit
04c38fff9a
@ -272,20 +272,22 @@ void SendCoinsDialog::darkSendStatus()
|
||||
// Balance and number of transactions might have changed
|
||||
cachedNumBlocks = nBestHeight;
|
||||
|
||||
if (model->getEncryptionStatus() != WalletModel::Unencrypted){
|
||||
if((nAnonymizeDarkcoinAmount*COIN)-pwalletMain->GetAnonymizedBalance() > 1.1*COIN && model->getEncryptionStatus() == WalletModel::Locked){
|
||||
WalletModel::UnlockContext ctx(model->requestUnlock());
|
||||
if(!ctx.isValid()){
|
||||
//unlock was cancelled
|
||||
fDisableDarksend = true;
|
||||
LogPrintf("Wallet is locked and user declined to unlock. Disabling Darksend.\n");
|
||||
if (pwalletMain->GetBalance() - pwalletMain->GetAnonymizedBalance() > 2*COIN){
|
||||
if (model->getEncryptionStatus() != WalletModel::Unencrypted){
|
||||
if((nAnonymizeDarkcoinAmount*COIN)-pwalletMain->GetAnonymizedBalance() > 1.1*COIN && model->getEncryptionStatus() == WalletModel::Locked){
|
||||
WalletModel::UnlockContext ctx(model->requestUnlock());
|
||||
if(!ctx.isValid()){
|
||||
//unlock was cancelled
|
||||
fDisableDarksend = true;
|
||||
LogPrintf("Wallet is locked and user declined to unlock. Disabling Darksend.\n");
|
||||
}
|
||||
}
|
||||
if((nAnonymizeDarkcoinAmount*COIN)-pwalletMain->GetAnonymizedBalance() <= 1.1*COIN &&
|
||||
model->getEncryptionStatus() == WalletModel::Unlocked &&
|
||||
darkSendPool.GetMyTransactionCount() == 0){
|
||||
LogPrintf("Darksend is complete, locking wallet.\n");
|
||||
model->Lock();
|
||||
}
|
||||
}
|
||||
if((nAnonymizeDarkcoinAmount*COIN)-pwalletMain->GetAnonymizedBalance() <= 1.1*COIN &&
|
||||
model->getEncryptionStatus() == WalletModel::Unlocked &&
|
||||
darkSendPool.GetMyTransactionCount() == 0){
|
||||
LogPrintf("Darksend is complete, locking wallet.\n");
|
||||
model->Lock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user