feat(wallet): consolidate notes per address, keeping each address's funds in place

Users who keep funds apart under different labelled addresses can now
shed notes (smaller wallet, faster scans/witness rebuilds) without the
funds being merged into a single address.

- Merge/Consolidate dialog: "Where should the funds go?" - Into one
  address (unchanged) or Keep in each address. The latter lists shielded
  addresses with 2+ spendable notes (label, note count, amount;
  too-small ones disabled) and merges each address's notes back into
  that address with z_mergetoaddress [addr] addr. Addresses with more
  notes than the batch size get several batches (the daemon locks a
  batch's notes before returning, so calls take disjoint notes); the
  dialog suggests a second run after those confirm. Per-address
  progress; ops keep running if the dialog is closed. The Consolidate
  (wallet-size) preset opens in this mode; Merge keeps "Into one".
  Shielded only: a transparent address can't take a merge's output.
- services/note_consolidation: groupSpendableNotes, worthConsolidating,
  estimateBatches, consolidateInPlace (pure; driven by a merge-call
  function), with unit tests against a stand-in following dragonxd's
  rules.
- fake_dragonxd: optional note wallet (FAKE_WALLET_NOTES,
  FAKE_MERGE_SECS) with z_mergetoaddress and its operations.
- i18n: 17 new keys in all 8 languages; CJK subset rebuilt.
- UI sweep: modal-consolidate target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-02 22:15:56 -05:00
co-authored by Claude Opus 5.5
parent e367eb47ff
commit 71ed92b9f1
19 changed files with 1016 additions and 6 deletions
+17
View File
@@ -1163,6 +1163,22 @@
"merge_description": "将多个 UTXO 合并到一个屏蔽地址。这可以帮助减小钱包大小并提高隐私性。",
"merge_fee_hint": "此交易的网络手续费。",
"merge_funds": "合并资金",
"merge_into_one": "合并到一个地址",
"merge_keep_each": "保留在各自地址",
"merge_keep_each_batches_fmt": "超过 %d 张票据的地址会分多批合并;确认后再运行一次即可合并其余部分。",
"merge_keep_each_confirm_fmt": "整合 %d 张票据,涉及 %d 个地址?每个地址保留各自的资金。手续费:约 %s DRGX(每批一次)。",
"merge_keep_each_desc": "每个地址的票据会合并回该地址本身,因此您用不同标签分开存放的资金仍保持分开。仅限屏蔽地址——透明资金只能被屏蔽(合并到一个地址)。",
"merge_keep_each_none": "每个屏蔽地址都只有一张票据——无需整合。",
"merge_keep_each_nothing_submitted": "没有任何整合——节点拒绝了所有合并。",
"merge_keep_each_row_fmt": "%s · %d 张票据 · %s DRGX",
"merge_keep_each_run_again": "分多批合并的地址现在每批各有一张票据。确认后再运行一次,即可把它们合并为一张。",
"merge_keep_each_select": "请至少勾选一个要整合的地址。",
"merge_keep_each_some_failed": "部分合并失败——请查看上方列表。",
"merge_keep_each_status_done": "%s——完成:已合并 %d 张票据,共 %d 批",
"merge_keep_each_status_failed": "%s——失败:%s",
"merge_keep_each_status_not_started": "%s——未开始:%s",
"merge_keep_each_status_running": "%s——正在合并 %d 张票据(已完成 %d/%d 批)…",
"merge_keep_each_too_small": "金额太小,无法整合:手续费会耗尽这些资金。",
"merge_max_inputs": "每批最大输入数",
"merge_no_spendable": "暂无可合并的可用输入。",
"merge_progress": "正在合并…这可能需要几分钟。您可以关闭此窗口。",
@@ -1175,6 +1191,7 @@
"merge_src_transparent": "透明",
"merge_started": "合并操作已开始",
"merge_title": "合并到地址",
"merge_where": "资金应转到哪里?",
"mig_adopt": "将其设为我的钱包",
"mig_adopt_now": "采用助记词钱包",
"mig_adopting": "正在安装您的新钱包并重新扫描…",