You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ffbfb06
Browse filesBrowse the repository at this point in the historyBrowse files
fix(wallet): never prune the just-written backup on clock skew
Retention ranked backups purely by the timestamp in their filenames and
protected the newest -createwalletbackups of them. After the system clock
moved backward, every backup written before the jump sorted ahead of the one
just created, which could then fall outside the count window and be deleted as
a non-oldest member of its age range, right after AutoBackupWallet() had
written it and reset nKeysLeftSinceAutoBackup.
Pass the time of the backup that triggered pruning into GetBackupsToDelete()
and consider only backups dated at or before it. The just-written backup is
therefore always the newest candidate, anchors the age ranges and sits inside
the count window. Backups dated after it cannot be placed relative to it, so
they are left untouched until the clock catches up rather than being ranked
ahead of the new backup or pruned against it. The time is floored to the
minute to match the precision ParseBackupFileTime() reads back from the name.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: doc/managing-wallets.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,7 +110,7 @@ Non-HD wallets must be backed up every 1000 keys used since the previous backup,
110
110
111
111
For legacy wallets, Dash Core automatically creates a backup in the `backups` directory inside the data directory on every startup and whenever the keypool is replenished. Each file is named after the wallet with the backup time appended, e.g. `wallet.dat.2026-08-02-14-30`.
112
112
113
-
Older backups are pruned as new ones are made. The most recent `-createwalletbackups` backups (default: 10, max: 20) are always kept. Beyond those, one backup is kept from each widening age range — 1-2 hours old, 2-4 hours, 4-8 hours, and so on, each range twice as long as the one before (512-1024 hours is about 3-6 weeks) — up to `-maxwalletbackups` files in total (default: 30). This preserves restore points going back months, even for a wallet that writes many backups a day while mixing, while keeping the size of the `backups` directory predictable. Several backups made within the same hour do not each get their own range: beyond the most recent `-createwalletbackups`, only the oldest backup in each range is kept.
113
+
Older backups are pruned as new ones are made. The most recent `-createwalletbackups` backups (default: 10, max: 20) are always kept. Beyond those, one backup is kept from each widening age range — 1-2 hours old, 2-4 hours, 4-8 hours, and so on, each range twice as long as the one before (512-1024 hours is about 3-6 weeks) — up to `-maxwalletbackups` files in total (default: 30). This preserves restore points going back months, even for a wallet that writes many backups a day while mixing, while keeping the size of the `backups` directory predictable. Several backups made within the same hour do not each get their own range: beyond the most recent `-createwalletbackups`, only the oldest backup in each range is kept. The backup just written is never pruned, and if the system clock has been set back, backups dated later than it are left untouched until the clock catches up with them.
114
114
115
115
Setting either option to `0` disables automatic backups, in which case existing backups are left untouched. Renaming a backup also excludes it from pruning, which is a simple way to keep one indefinitely.
0 commit comments