@@ -498,9 +498,10 @@ void OverviewPage::coinJoinStatus(bool fForce)
498498 if (!fForce && (clientModel->node ().shutdownRequested () || !clientModel->masternodeSync ().isBlockchainSynced ())) return ;
499499
500500 // Disable any PS UI for masternode or when autobackup is disabled or failed for whatever reason
501- if (clientModel->node ().isMasternode () || nWalletBackups <= 0 ) {
501+ int backupStatus = walletModel->wallet ().getWalletBackupStatus ();
502+ if (clientModel->node ().isMasternode () || backupStatus <= 0 ) {
502503 DisableCoinJoinCompletely ();
503- if (nWalletBackups <= 0 ) {
504+ if (backupStatus <= 0 ) {
504505 ui->labelCoinJoinEnabled ->setToolTip (tr (" Automatic backups are disabled, no mixing available!" ));
505506 }
506507 return ;
@@ -595,7 +596,7 @@ void OverviewPage::coinJoinStatus(bool fForce)
595596
596597 // Warn user that wallet is running out of keys
597598 // NOTE: we do NOT warn user and do NOT create autobackups if mixing is not running
598- if (walletModel->wallet ().isLegacy () && nWalletBackups > 0 && walletModel->getKeysLeftSinceAutoBackup () < COINJOIN_KEYS_THRESHOLD_WARNING) {
599+ if (walletModel->wallet ().isLegacy () && walletModel-> wallet (). getWalletBackupStatus () > 0 && walletModel->getKeysLeftSinceAutoBackup () < COINJOIN_KEYS_THRESHOLD_WARNING) {
599600 QSettings settings;
600601 if (settings.value (" fLowKeysWarning" ).toBool ()) {
601602 QString strWarn = tr (" Very low number of keys left since last automatic backup!" ) + " <br><br>" +
@@ -639,7 +640,8 @@ void OverviewPage::coinJoinStatus(bool fForce)
639640 ui->labelCoinJoinEnabled ->setText (strEnabled);
640641
641642 if (walletModel->wallet ().isLegacy ()) {
642- if (nWalletBackups == -1 ) {
643+ int backupStatus = walletModel->wallet ().getWalletBackupStatus ();
644+ if (backupStatus == -1 ) {
643645 // Automatic backup failed, nothing else we can do until user fixes the issue manually
644646 DisableCoinJoinCompletely ();
645647
@@ -649,7 +651,7 @@ void OverviewPage::coinJoinStatus(bool fForce)
649651 ui->labelCoinJoinEnabled ->setToolTip (strError);
650652
651653 return ;
652- } else if (nWalletBackups == -2 ) {
654+ } else if (backupStatus == -2 ) {
653655 // We were able to create automatic backup but keypool was not replenished because wallet is locked.
654656 QString strWarning = tr (" WARNING! Failed to replenish keypool, please unlock your wallet to do so." );
655657 ui->labelCoinJoinEnabled ->setToolTip (strWarning);
@@ -754,7 +756,7 @@ void OverviewPage::DisableCoinJoinCompletely()
754756
755757 ui->toggleCoinJoin ->setText (" (" + tr (" Disabled" ) + " )" );
756758 ui->frameCoinJoin ->setEnabled (false );
757- if (nWalletBackups <= 0 ) {
759+ if (walletModel && walletModel-> wallet (). getWalletBackupStatus () <= 0 ) {
758760 ui->labelCoinJoinEnabled ->setText (" <span style='" + GUIUtil::getThemedStyleQString (GUIUtil::ThemedStyle::TS_ERROR) + " '>(" + tr (" Disabled" ) + " )</span>" );
759761 }
760762 walletModel->coinJoin ()->stopMixing ();
0 commit comments