Fix extra warning about low keys on wallet encryption

This commit is contained in:
UdjinM6 2016-08-18 05:06:18 +03:00
parent de7b2b6c51
commit 5d62e4fc81
2 changed files with 19 additions and 12 deletions

View File

@ -461,7 +461,25 @@ void OverviewPage::privateSendStatus()
}
ui->labelPrivateSendEnabled->setToolTip(strKeysLeftText);
if (!fEnablePrivateSend) {
if (nBestHeight != darkSendPool.nCachedNumBlocks) {
darkSendPool.nCachedNumBlocks = nBestHeight;
updatePrivateSendProgress();
}
ui->labelPrivateSendLastMessage->setText("");
ui->togglePrivateSend->setText(tr("Start Mixing"));
QString strEnabled = tr("Disabled");
// Show how many keys left in advanced PS UI mode only
if (fShowAdvancedPSUI) strEnabled += ", " + strKeysLeftText;
ui->labelPrivateSendEnabled->setText(strEnabled);
return;
}
// Warn user that wallet is running out of keys
// NOTE: we do NOT warn user and do NOT create autobackups if mixing is not running
if (nWalletBackups > 0 && pwalletMain->nKeysLeftSinceAutoBackup < PRIVATESEND_KEYS_THRESHOLD_WARNING) {
QSettings settings;
if(settings.value("fLowKeysWarning").toBool()) {
@ -520,18 +538,6 @@ void OverviewPage::privateSendStatus()
ui->labelPrivateSendEnabled->setToolTip(strWarning);
}
if(!fEnablePrivateSend) {
if(nBestHeight != darkSendPool.nCachedNumBlocks) {
darkSendPool.nCachedNumBlocks = nBestHeight;
updatePrivateSendProgress();
}
ui->labelPrivateSendLastMessage->setText("");
ui->togglePrivateSend->setText(tr("Start Mixing"));
return;
}
// check darksend status and unlock if needed
if(nBestHeight != darkSendPool.nCachedNumBlocks) {
// Balance and number of transactions might have changed

View File

@ -3658,6 +3658,7 @@ bool CWallet::NewKeyPool()
BOOST_FOREACH(int64_t nIndex, setKeyPool)
walletdb.ErasePool(nIndex);
setKeyPool.clear();
fEnablePrivateSend = false;
pwalletMain->nKeysLeftSinceAutoBackup = 0;
if (IsLocked())