feat(wallet): add a Compact action to reclaim space after consolidating
Consolidating reduces the note count and stops the wallet growing, but Berkeley
DB never shrinks wallet.dat in place, so the freed space isn't returned to the OS
and the displayed size doesn't drop. Add an explicit "Compact wallet…" action
(next to "Consolidate notes…" in the large-wallet area of Node & Security) that
rewrites the file into a fresh, compact one.
App::compactWallet() arms the daemon's -salvagewallet flag for the next start and
calls restartDaemon() (reusing its full-node / busy / lifecycle guards); the
daemon rewrites wallet.dat into a smaller file, keeps the old one as a timestamped
.bak, and — because -salvagewallet implies -rescan — re-scans the chain. If the
restart is refused the salvage flag is disarmed so it can't fire on a later
restart. A confirmation overlay (mirroring the repair-wallet one) explains the
restart + rescan + that funds/balance are safe and a backup is kept. New strings
wallet_size_compact / tt_wallet_size_compact / compact_started /
confirm_compact_wallet_{title,msg,safe} / compact_wallet_confirm.
Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -878,6 +878,13 @@ void I18n::loadBuiltinEnglish()
|
||||
strings_["wallet_size_auto_info"] = "Your wallet has built up a lot of notes \xE2\x80\x94 separate pieces of received funds that enlarge the file and slow syncing. Auto-consolidation is quietly merging them in the background to keep it small and fast, so there's nothing you need to do.";
|
||||
strings_["tt_wallet_size_warn"] = "Each payment arrives as a separate shielded note, and every note carries witness data that grows the wallet file and slows scans. Merging many notes into one per address shrinks it \xE2\x80\x94 your funds and balance are unchanged. Back up your seed first. You can also turn on Auto-consolidate in Settings to do this automatically in the background.";
|
||||
strings_["wallet_size_consolidate"] = "Consolidate notes\xE2\x80\xA6";
|
||||
strings_["wallet_size_compact"] = "Compact wallet\xE2\x80\xA6";
|
||||
strings_["tt_wallet_size_compact"] = "Reclaim the disk space freed by consolidating. Berkeley DB can't shrink the file in place, so this rewrites wallet.dat into a smaller file and restarts the node with a full rescan (can take a while). A backup of the current wallet is kept.";
|
||||
strings_["compact_started"] = "Compacting wallet \xE2\x80\x94 the node is restarting and will re-scan the chain.";
|
||||
strings_["confirm_compact_wallet_title"] = "Compact wallet";
|
||||
strings_["confirm_compact_wallet_msg"] = "Consolidating merged your notes, but the wallet file can't shrink on its own \xE2\x80\x94 the node has to rewrite it to reclaim the freed space. This restarts the node and re-scans the blockchain, which can take a while on a large wallet.";
|
||||
strings_["confirm_compact_wallet_safe"] = "Your funds and balance are safe \xE2\x80\x94 a timestamped backup of the current wallet is kept.";
|
||||
strings_["compact_wallet_confirm"] = "Compact";
|
||||
strings_["settings_debug_changed"] = "Debug categories changed \xe2\x80\x94 restart daemon to apply";
|
||||
strings_["settings_auto_detected"] = "Auto-detected from DRAGONX.conf";
|
||||
strings_["settings_visual_effects"] = "Visual Effects";
|
||||
|
||||
Reference in New Issue
Block a user