feat(merge): run per-address consolidation as a paced background job

"Keep in each address" posted one task that called z_mergetoaddress for
every batch of every address back to back; each call is a whole-wallet
scan under cs_main, and the daemon runs the ops one at a time anyway.
It is now an App-owned services::ConsolidationRun:

- one RPC at a time; the next merge only after the previous batch left the
  queue and a gap as long as the last call took (2-120 s);
- pauses while the node syncs, the wallet is locked, a send of ours is in
  progress, or another wallet scan is running;
- failures classified: nothing that may have queued is ever resent; a
  breaker stops after 3 dead addresses or 3 failed ops in a row;
- each merge is charged to the scan budget; one re-read and one forced
  balance at the end;
- it keeps running when the dialog closes: a status-bar chip, a run view
  with progress, the wait reason and a Stop button.

The "Into one" merge can no longer be confirmed twice while its call is
in flight. fake_dragonxd gains FAKE_SCAN_SECS, FAKE_MERGE_SERIAL and
FAKE_MERGE_FAIL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 11:06:34 -05:00
co-authored by Claude Opus 5.5
parent b29a09eaa0
commit cee8b9d7f6
19 changed files with 1875 additions and 202 deletions
+16
View File
@@ -1183,6 +1183,22 @@
"merge_max_inputs": "Nombre max d'entrées par lot",
"merge_no_spendable": "Aucune entrée dépensable à consolider pour l'instant.",
"merge_progress": "Consolidation en cours… cela peut prendre quelques minutes. Vous pouvez fermer cette fenêtre.",
"merge_run_aborted_toast": "La connexion au nœud a été réinitialisée, la consolidation s'est donc arrêtée. Relancez-la pour continuer.",
"merge_run_busy": "Une consolidation est en cours. Attendez qu'elle se termine ou arrêtez-la d'abord.",
"merge_run_chip_fmt": "Consolidation %d/%d",
"merge_run_err_timeout": "Le nœud n'a pas répondu à temps ; le lot est peut-être encore en file d'attente.",
"merge_run_halted_fmt": "Consolidation arrêtée après des échecs répétés : %s",
"merge_run_migration_pending": "Terminez ou annulez la migration de la phrase de récupération avant de consolider.",
"merge_run_progress_fmt": "Consolidation en cours… lot %d sur environ %d, %d notes fusionnées jusqu'ici. Vous pouvez fermer cette fenêtre ; l'opération continue en arrière-plan.",
"merge_run_start_failed": "Impossible de démarrer la consolidation — le nœud n'est pas connecté.",
"merge_run_status_not_run": "%s — non consolidé (%d notes)",
"merge_run_status_waiting": "%s — en attente (%d notes)",
"merge_run_stop": "Arrêter",
"merge_run_stopped_toast": "Consolidation arrêtée. Relancez-la pour fusionner le reste.",
"merge_run_stopping": "Arrêt après les lots déjà envoyés…",
"merge_run_wait_batch": "Espacement des lots pour que le nœud reste réactif…",
"merge_run_wait_send": "En pause jusqu'à ce que votre transaction en attente soit passée.",
"merge_run_wait_sync": "En pause : le nœud est encore en cours de synchronisation.",
"merge_scope_failed_fmt": "Impossible de lire vos entrées : %s",
"merge_scope_fmt": "%d entrées transparentes + %d blindées · ~%s DRGX dépensables",
"merge_scope_loading": "Vérification de vos entrées…",