Merge #946: Fix extra warning about low keys on wallet encryption

5d62e4f Fix extra warning about low keys on wallet encryption
This commit is contained in:
UdjinM6 2016-08-19 15:47:37 +04:00 committed by Holger Schinzel
parent 7d55e623a8
commit 66de5b082a
2 changed files with 19 additions and 12 deletions

View File

@ -461,7 +461,25 @@ void OverviewPage::privateSendStatus()
} }
ui->labelPrivateSendEnabled->setToolTip(strKeysLeftText); 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 // 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) { if (nWalletBackups > 0 && pwalletMain->nKeysLeftSinceAutoBackup < PRIVATESEND_KEYS_THRESHOLD_WARNING) {
QSettings settings; QSettings settings;
if(settings.value("fLowKeysWarning").toBool()) { if(settings.value("fLowKeysWarning").toBool()) {
@ -520,18 +538,6 @@ void OverviewPage::privateSendStatus()
ui->labelPrivateSendEnabled->setToolTip(strWarning); 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 // check darksend status and unlock if needed
if(nBestHeight != darkSendPool.nCachedNumBlocks) { if(nBestHeight != darkSendPool.nCachedNumBlocks) {
// Balance and number of transactions might have changed // Balance and number of transactions might have changed

View File

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