-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: surface specific autobackup-failure tooltips in CoinJoin status #7515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -526,8 +526,14 @@ void OverviewPage::coinJoinStatus(bool fForce) | |
| // Disable any PS UI for masternode or when autobackup is disabled or failed for whatever reason | ||
| if (clientModel->node().isMasternode() || nWalletBackups <= 0) { | ||
| DisableCoinJoinCompletely(); | ||
| if (nWalletBackups <= 0) { | ||
| if (nWalletBackups == 0) { | ||
| ui->labelCoinJoinEnabled->setToolTip(tr("Automatic backups are disabled, no mixing available!")); | ||
| } else if (nWalletBackups == -1) { | ||
| ui->labelCoinJoinEnabled->setToolTip(tr("ERROR! Failed to create automatic backup") + ", " + | ||
| tr("see debug.log for details.") + "<br><br>" + | ||
| tr("Mixing is disabled, please close your wallet and fix the issue!")); | ||
| } else if (nWalletBackups == -2) { | ||
| ui->labelCoinJoinEnabled->setToolTip(tr("WARNING! Failed to replenish keypool, please unlock your wallet to do so.")); | ||
|
coderabbitai[bot] marked this conversation as resolved.
Comment on lines
+535
to
+536
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In a multiwallet GUI, this branch also runs on OverviewPages belonging to wallets that did not encounter the failure: Useful? React with 👍 / 👎.
Comment on lines
526
to
+536
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Add regression coverage for backup-status tooltip selection This three-way branch (nWalletBackups == 0 / -1 / -2) is the core of the bug fix, but nothing verifies it stays correct going forward — a future refactor could silently reintroduce the original bug where the generic tooltip overwrites the specific ones. src/qt/test/wallettests.cpp already builds an OverviewPage wired to ClientModel and WalletModel in TestGUI, so this is directly testable: set OverviewPage's nWalletBackups to each of 0, -1, -2, call coinJoinStatus(true), and assert ui->labelCoinJoinEnabled->toolTip() matches the expected string for each. Restore the prior nWalletBackups value afterward so it doesn't leak into other assertions in the same test. source: ['codex']
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added in 0d7a9d6 |
||
| } | ||
| return; | ||
| } | ||
|
|
@@ -666,22 +672,11 @@ void OverviewPage::coinJoinStatus(bool fForce) | |
| if(fShowAdvancedCJUI && !strKeysLeftText.isEmpty()) strEnabled += ", " + strKeysLeftText; | ||
| ui->labelCoinJoinEnabled->setText(strEnabled); | ||
|
|
||
| if (walletModel->wallet().isLegacy()) { | ||
| if(nWalletBackups == -1) { | ||
| // Automatic backup failed, nothing else we can do until user fixes the issue manually | ||
| DisableCoinJoinCompletely(); | ||
|
|
||
| QString strError = tr("ERROR! Failed to create automatic backup") + ", " + | ||
| tr("see debug.log for details.") + "<br><br>" + | ||
| tr("Mixing is disabled, please close your wallet and fix the issue!"); | ||
| ui->labelCoinJoinEnabled->setToolTip(strError); | ||
|
|
||
| return; | ||
| } else if(nWalletBackups == -2) { | ||
| // We were able to create automatic backup but keypool was not replenished because wallet is locked. | ||
| QString strWarning = tr("WARNING! Failed to replenish keypool, please unlock your wallet to do so."); | ||
| ui->labelCoinJoinEnabled->setToolTip(strWarning); | ||
| } | ||
| if (walletModel->wallet().isLegacy() && nWalletBackups == -1) { | ||
| // Automatic backup failed, nothing else we can do until user fixes the issue manually. | ||
| // Stop mixing right away; the guard above sets the matching tooltip on the next timer tick. | ||
| DisableCoinJoinCompletely(); | ||
| return; | ||
| } | ||
|
|
||
| // check coinjoin status and unlock if needed | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
AutoBackupWallet()setsnWalletBackupsto-1while mixing is active, this relocated guard has already been passed. Removing the later-1block therefore lets the current invocation continue, display the status as enabled, and leave the client mixing until a subsequent GUI timer tick reaches this guard;CheckAutomaticBackup()merely returns false for-1and does not callstopMixing(). Preserve the immediateDisableCoinJoinCompletely()path so the modal's claim that mixing is disabled is true as soon as the backup fails.Useful? React with 👍 / 👎.