-
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
base: develop
Are you sure you want to change the base?
Changes from all commits
c6f23e2
8e06dde
dc0a7a3
0efabe0
a646f91
8df14ca
ce185aa
93768ed
e2e0006
ccec0c0
a628851
30a0fb2
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -59,7 +59,8 @@ void WalletInit::AddWalletOptions(ArgsManager& argsman) const | |||||
| { | ||||||
| argsman.AddArg("-avoidpartialspends", strprintf("Group outputs by address, selecting many (possibly all) or none, instead of selecting on a per-output basis. Privacy is improved as addresses are mostly swept with fewer transactions and outputs are aggregated in clean change addresses. It may result in higher fees due to less optimal coin selection caused by this added limitation and possibly a larger-than-necessary number of inputs being used. Always enabled for wallets with \"avoid_reuse\" enabled, otherwise default: %u.", DEFAULT_AVOIDPARTIALSPENDS), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||||
| argsman.AddArg("-consolidatefeerate=<amt>", strprintf("The maximum feerate (in %s/kvB) at which transaction building may use more inputs than strictly necessary so that the wallet's UTXO pool can be reduced (default: %s).", CURRENCY_UNIT, FormatMoney(DEFAULT_CONSOLIDATE_FEERATE)), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||||
| argsman.AddArg("-createwalletbackups=<n>", strprintf("Number of automatic wallet backups (default: %u)", nWalletBackups), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||||
| argsman.AddArg("-createwalletbackups=<n>", strprintf("Number of automatic wallet backups to keep most recent (default: %u, max: %u). Older backups are kept at exponentially spaced intervals.", DEFAULT_N_WALLET_BACKUPS, MAX_N_WALLET_BACKUPS), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||||
|
Collaborator
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. I think 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. 💬 Nitpick: Awkward grammar in -createwalletbackups help text The help text reads "Number of automatic wallet backups to keep most recent" which is grammatically unclear — "keep most recent" lacks an article and reads ambiguously. 💡 Suggested change
Suggested change
source: ['claude'] |
||||||
| argsman.AddArg("-maxwalletbackups=<n>", strprintf("Maximum total number of automatic wallet backups to keep (default: %u)", DEFAULT_MAX_BACKUPS), ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||||
| argsman.AddArg("-disablewallet", "Do not load the wallet and disable wallet RPC calls", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||||
| #if HAVE_SYSTEM | ||||||
| argsman.AddArg("-instantsendnotify=<cmd>", "Execute command when a wallet InstantSend transaction is successfully locked. %s in cmd is replaced by TxID and %w is replaced by wallet name. %w is not currently implemented on Windows. On systems where %w is supported, it should NOT be quoted because this would break shell escaping used to invoke the command.", ArgsManager::ALLOW_ANY, OptionsCategory::WALLET); | ||||||
|
|
||||||
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)