forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: implement exponential retention for wallet backups #7005
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
Open
PastaPastaPasta
wants to merge
12
commits into
dashpay:develop
Choose a base branch
from
PastaPastaPasta:feat/wallet-backups
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
c659999
feat: implement exponential retention for wallet backups
PastaPastaPasta 6b7aa15
fix: missing file
PastaPastaPasta 4e3849d
fix: apply changes as suggested by coderabbit
PastaPastaPasta bd1549e
fix: coderabbit suggestions in test
PastaPastaPasta 39e4adb
fix: whitespace
PastaPastaPasta 6e615d9
fix: use ToString and fix trailing whitespace
PastaPastaPasta 3793600
fix: redundant declaration
PastaPastaPasta 6c43f2d
fix: use rolling exponential ranges for backup retention
PastaPastaPasta 1e40610
fix: use time-based exponential retention for wallet backups
UdjinM6 2ca3842
test: update backup tests for time-based exponential retention
UdjinM6 d7a5176
refactor: deduplicate backup initialization logic
UdjinM6 94ffc35
fix: remove duplicate global nWalletBackups variable
UdjinM6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Differentiate “disabled” vs “error/locked” backup states in CoinJoin UI
Right now
coinJoinStatus()treats every non‑positivebackupStatusthe same in the early guard:backupStatus <= 0disables CoinJoin completely and sets a generic tooltip “Automatic backups are disabled, no mixing available!”.backupStatus == -1(fatal backup error) andbackupStatus == -2(wallet locked, keypool not replenished), but that code is only effective within the same invocation where the failure occurs. On subsequent timer ticks, the earlybackupStatus <= 0guard runs first and overwrites those more informative messages with the generic one.This makes it hard for users to distinguish “I turned backups off” from “backups are failing” or “unlock your wallet to replenish the keypool”, and for the
-2case you end up disabling the CoinJoin UI entirely on the next tick even though the later block was only warning.Consider restricting the early guard to the truly “disabled” state and letting the negative sentinel states be handled exclusively by the later block:
With this change:
0(disabled) still fully disables CoinJoin with the generic tooltip.-1and-2are handled only in the legacy‑wallet block later in the function, so the more detailed error/warning text is preserved and not overwritten on the next tick.DisableCoinJoinCompletely()continues to usegetWalletBackupStatus() <= 0to decide when to show the red “(Disabled)” label, which remains appropriate for both “disabled” and error states.Also applies to: 597-599, 642-655, 751-761
🧰 Tools
🪛 Cppcheck (2.18.0)
[information] Too many #ifdef configurations - cppcheck only checks 12 configurations. Use --force to check all configurations. For more details, use --enable=information.
(toomanyconfigs)