Skip to content

Commit

Permalink
fix: auto backup issue with descriptor wallets for CJ
Browse files Browse the repository at this point in the history
  • Loading branch information
knst committed Jul 1, 2024
1 parent 37e026a commit 7198f97
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ void OverviewPage::coinJoinStatus(bool fForce)
if(walletModel->getKeysLeftSinceAutoBackup() < COINJOIN_KEYS_THRESHOLD_WARNING) {
strKeysLeftText = "<span style='" + GUIUtil::getThemedStyleQString(GUIUtil::ThemedStyle::TS_ERROR) + "'>" + strKeysLeftText + "</span>";
}
if (!walletModel->wallet().isLegacy()) {
// we don't need in auto-back for case of Descriptor wallets
strKeysLeftText = "";
}
ui->labelCoinJoinEnabled->setToolTip(strKeysLeftText);

QString strCoinJoinName = QString::fromStdString(gCoinJoinName);
Expand All @@ -553,7 +557,7 @@ void OverviewPage::coinJoinStatus(bool fForce)

QString strEnabled = tr("Disabled");
// Show how many keys left in advanced PS UI mode only
if (fShowAdvancedCJUI) strEnabled += ", " + strKeysLeftText;
if (fShowAdvancedCJUI && !strKeysLeftText.isEmpty()) strEnabled += ", " + strKeysLeftText;
ui->labelCoinJoinEnabled->setText(strEnabled);

// If mixing isn't active always show the lower number of txes because there are
Expand All @@ -567,7 +571,7 @@ void OverviewPage::coinJoinStatus(bool fForce)

// 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 && walletModel->getKeysLeftSinceAutoBackup() < COINJOIN_KEYS_THRESHOLD_WARNING) {
if (walletModel->wallet().isLegacy() && nWalletBackups > 0 && walletModel->getKeysLeftSinceAutoBackup() < COINJOIN_KEYS_THRESHOLD_WARNING) {
QSettings settings;
if(settings.value("fLowKeysWarning").toBool()) {
QString strWarn = tr("Very low number of keys left since last automatic backup!") + "<br><br>" +
Expand Down Expand Up @@ -607,7 +611,7 @@ void OverviewPage::coinJoinStatus(bool fForce)

QString strEnabled = walletModel->coinJoin()->isMixing() ? tr("Enabled") : tr("Disabled");
// Show how many keys left in advanced PS UI mode only
if(fShowAdvancedCJUI) strEnabled += ", " + strKeysLeftText;
if(fShowAdvancedCJUI && !strKeysLeftText.isEmpty()) strEnabled += ", " + strKeysLeftText;
ui->labelCoinJoinEnabled->setText(strEnabled);

if(nWalletBackups == -1) {
Expand Down

0 comments on commit 7198f97

Please sign in to comment.