UX audit, Contacts surface — discoverability (choice a):
- "Message" (open a chat) was reachable only from the right-click menu. It now also
appears as a per-row hover icon and a toolbar button, disabled with a "needs a
shielded (z) address" tooltip when the contact is transparent.
- New "Send to" action (per-row icon, toolbar button, context menu) prefills the
Send tab's recipient with the contact and switches there. Backed by a new
PrefillSendRecipient() that fills only the recipient (amount/memo left to the user),
distinct from the demo-only SweepSetSendRecipient.
- The per-row action cluster is refactored to id-based dispatch so the two new
actions slot in without positional-index fragility; width is reserved for the
full cluster so the address text doesn't shift on hover.
New string (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Contacts surface — search & sort affordances (choice a):
- A trailing (x) clears the search box, and Escape clears it while focused.
- Cards & List gain a sort toggle (name / recently added) in the toolbar, beside
the view switch; Table keeps its own sortable headers. "Recently added" uses
storage/append order (newest first).
New strings (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Contacts surface (batch 2):
- F005: Save is disabled (with an inline red hint) when the address fails the same
recipient validator the Send tab uses — a contact can no longer be saved with an
address that would only fail later at send time.
- F006: an armed per-row delete names the consequence ("Click again to delete <label>
— cannot be undone") instead of leaving the tooltip on "Delete".
- F044: the avatar-library delete badge gets a larger hit target and an explicit
armed-state tooltip.
- F078: the bare Z/T letter in Table view gets a hover tooltip (shielded / mining).
New strings (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Contacts surface (batch 1):
- F001: a selection hidden by the search or wallet-scope filter is cleared, so a
toolbar action (delete/edit/copy) can never act on an off-screen contact.
- F042: the empty state now reads from the real state — "No matching contacts"
when searching, "No contacts for this wallet yet" when contacts exist only in
another wallet's scope, vs. the first-run empty message.
- F023: the footer shows "N of M contacts" when a filter/scope hides rows.
- F043: the disabled Edit/Delete/Copy buttons show a "Select a contact first" hint.
New strings (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Export transactions dialog:
- F034: the Export button is disabled when the scope is stale/invalid or no rows
match, with the reason spelled out inline next to the count (was: always enabled,
reason only shown as a toast after clicking).
- F073: a persistent "Open folder" link (not only on the success screen), and an
existing file is auto-suffixed (-2, -3, …) instead of being silently overwritten.
- F085: the error line uses the themed ErrorVec4() instead of a raw literal.
F096 (export shield legs as one merged row) deferred — needs a shared shield-merge
helper with the History list. Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, transaction detail dialog:
- F016: the confirmations badge now shows "Dropped" (red) for a conflicted/
reorged tx (conf < 0) and "Expired?" (amber) for a long-stale 0-conf, mirroring
the list, instead of a green "-1 confirmations".
- F033: type colors use theme tokens (Secondary / Primary / OnSurfaceMedium)
instead of raw ImVec4 literals, and tiny USD amounts show ~$0.00xx (tiered).
- F015: a "shield" tx renders a "Shielded (moved to your own z-address)" label.
New string (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Transactions surface (batch 1):
- F015: opening details for an autoshield row now shows the SHIELD view
(positive amount, from mining t-addr → z-addr) via a synthesized TransactionInfo,
instead of its raw send leg which read as "Sent -amount".
- F065: a mined coinbase row at 10-99 confirmations shows "Immature (n/100)" in
amber instead of a green "Confirmed" — the funds aren't spendable until 100.
- F097: the "no matching" empty state gets a one-click "Clear filters" button
(resets the type filter and search).
New strings (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Balance surface (batch 3):
- F069: clicking a Recent Transactions row now opens that transaction's detail
dialog (was: jump to the unfiltered History tab). 0-conf rows are dimmed and
marked with a clock, so a pending tx no longer looks settled. Choice a.
- F039: a persistent one-line hint under the address list explains the row
gestures (click to copy, drag to move funds, drag between rows to reorder),
which were invisible until a drag started. Choice a.
New strings (English). Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Balance: the fiat line showed the cryptic "$-.-- USD" whenever the USD
value was 0 — both for a genuine zero balance and for an unavailable price. A
shared FormatFiatFallback now shows "$0.00 USD" when a price is known (balance is
zero) and "Price unavailable" when there's no price, across all six spots. New
string. Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Balance surface (batch 1):
- F003: the per-row eye only hides an EMPTY or already-hidden address now (match
the right-click menu) — hiding a funded address on one unconfirmed click was a
fund-visibility footgun; a tooltip explains when it's disabled.
- F021: the create-address buttons show "Available once sync finishes" while
greyed during sync.
- F038: creating an address now toasts success/failure instead of only logging.
- F074: generic transactions get a neutral swap icon; the hard-hat icon now means
mined only (shield gets the shield icon).
New strings (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Receive surface (batch 2):
- F051: a compact expand button beside Copy opens the full-screen QR popup (large
QR + full chunked address) for a shielded address — the tab only shows a
truncated address. Choice a.
- F052: the QR popup warns when the address is transparent (mining) — it can't
receive payments — reusing mining_addr_explainer.
- F027: clamp the Request-payment dialog amount to >= 0 (and NaN), matching the
Receive tab.
- F026: scale the request dialog's QR and memo box by dpiScale so they aren't
native-size on HiDPI.
Receive surface complete (11/11). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Receive surface (batch 1):
- F002: build the "Copy request" text in a std::string so a long memo's URI is
never silently truncated (was a 1024-char buffer).
- F008: build the payment URI / QR when an amount OR a memo is set, so a
memo-only request isn't a bare address; Copy URI / Copy request follow suit.
- F009: when the QR fails to encode (usually an over-long memo) say so and point
to Copy URI, instead of a bare "QR unavailable".
- F028: rename "Share" to "Copy request" and add tooltips distinguishing it
(address + amount + link) from Copy URI (just the drgx: link).
- F049: hide Explorer for shielded addresses — a z-address shows nothing on an
explorer and the click would leak your receiving address; keep it (with a
tooltip) for transparent/mining addresses. Choice a.
- F050: replace the cryptic [Z]/[T] source tags with "Shielded"/"Mining"; TR the
share "URI" label.
- F083: Clear now has a tooltip and a one-step Undo (restores the amount + memo
in the same slot). Choice a.
New strings (English; locales fall back). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Send surface: after a send the card showed only "Transaction sent" + a
truncated txid. It now reads "Sent 2.5000 DRGX to <label/address>" (captured at
dispatch, before the form clears) and offers a History button beside Copy. Choice
a. 2 new strings (English). Build + tests green. Send surface done except F056
(HiDPI), held for a cross-surface DPI pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Send surface: the "Recent Sends" list lumped shield/auto-shield
transactions in with real payments — same red "-amount" and "Sent" label — so a
move to your own z-address looked like paying a stranger. Now shield rows get the
shield icon, the "Shielded" label, and a neutral unsigned amount. All rows show a
saved contact label when one exists and the full address on hover; clicking a
real send pre-fills it as the recipient ("send again"), while a shield row still
opens History. Choice a. New string (English). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
UX audit, Send surface (batch 2):
- F055: each fee tier (Low/Normal/High) now shows its exact fee on hover, on the
compose form and the confirm.
- F057: replace the cryptic, untranslated [Z]/[T] source tags with TR'd
"Private" / "Mining", and add a tooltip to the unlabeled DRGX⇄USD toggle.
- F058: show the reason Review/Send is greyed as a visible caption (not only the
hover tooltip) — not connected / select a source / mining address / invalid
address / no amount / can't afford / view-only — reusing the tooltip's reason
chain so the two stay in sync.
New strings (English; locales fall back). Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
First batch of the 2026-11 UX audit, Send surface — the pre-broadcast confirm:
- F029: round the amount-bar drag to satoshi precision, so the value reviewed in
the confirm is exactly what's sent / affordability-checked (text entry already
rounded).
- F011: wrap the memo in the confirm (a long / multi-line memo was clipped off
the card), and repeat the transparent-source privacy warning on the confirm,
not just the compose form.
- F054: flag a recipient with no saved label and no prior send to it ("New
recipient — verify the full address") and show its first/last characters for an
easy compare — the clearest cue against a swapped/clipboard address.
- F053: on the live re-validation at Confirm, name the specific reason (not
connected / syncing / no tip / no amount / can't afford) instead of one generic
"cannot send now", reusing the disabled-Review reason chain.
- F010: a locked encrypted lite wallet now tells the user to unlock and closes
the confirm, instead of silently doing nothing behind it.
3 new strings (English; locales fall back). Build + tests green. Decisions pulled
from the tracked audit artifact (F054 = option a).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-up to the key-import fix: an audit found the same ASCII-only-trim pattern
across the input layer, where a pasted value carrying CJK full-width (U+3000),
NBSP, zero-width, or BOM whitespace survived trimming and then failed validation
or an RPC. Most paths failed closed (same value validated and acted on → "won't
work" rather than a wrong send), but several mattered — above all the Lite
Import Key path, the exact recurrence of the reported bug on the Lite variant.
Single-token inputs (keys, addresses, URLs) now go through
util::stripAllWhitespaceForKey; path/label inputs use the new
util::trimUnicodeWhitespace (edge-trim, preserves internal spaces):
- Lite Import Key (settings_page) — strip-all before importKeyAsync. [fund recovery]
- Lite wallet path (open/restore) — edge-trim the request path AND the empty gate
(they had diverged: gate trimmed, request used raw).
- Contacts — gate on and save the cleaned label/address; clean on paste; an
address never persists with stray whitespace (which silently broke every later
use + defeated duplicate detection).
- Send recipient — strip-all on paste and on field edit, so a CJK-pasted valid
address validates and sends.
- Chat new-conversation z-address — validate and send the cleaned value.
- Chat restore-by-address — strip-all (the old trim even missed '\r'), so a
padded address matches the deleted list instead of broadcasting a junk memo.
- Mining pool URL + payout — strip-all at persist and in the payout check.
- Validate-address dialog — strip-all before classify.
- Lite custom server URL — strip-all; its label edge-trimmed.
- Payment URI — strip-all the parsed address.
- Defense-in-depth: importPrivateKey / sweepPrivateKey strip-all the key;
importWalletFile edge-trims the path.
Adds trimUnicodeWhitespace coverage to testKeyInputSanitization. Build + tests +
hygiene green. (Deferred, noted for follow-up: the console tokenizer treating
Unicode whitespace as a separator, and repairing already-polluted address-book
entries on load.)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Users (notably in the Chinese community) hit "Invalid spending key" when
importing/sweeping an otherwise-valid shielded spending key. Root cause: the
Import Key dialog classified the TRIMMED key (so the UI showed it as valid) but
handed the RAW import_key_input_ buffer to z_importkey/sweep — and the trim was
ASCII-only (' ' \t \n \r). CJK clipboards commonly inject whitespace that an
ASCII trim leaves behind — above all a trailing U+3000 ideographic space, plus
NBSP / zero-width / BOM — so a trailing such character passed the prefix
classifier (UI "valid") but reached the daemon's DecodeSpendingKey() verbatim,
which failed the Bech32 decode → "Invalid spending key". Native Ctrl+V also
bypassed the paste-button trim entirely, so even plain ASCII whitespace reached
the RPC. This is why it hit CJK users systematically and others rarely.
Add util::stripAllWhitespaceForKey (UTF-8 aware; removes every whitespace code
point, ASCII + Unicode, including internal ones — a key is a single token). The
dialog now classifies AND sends this cleaned key (keyTrim), the key Paste button
cleans the field with it, and trimmedClipboardText (addresses etc.) now
edge-trims Unicode whitespace too. Covers spending, viewing, and WIF imports and
the sweep path. Present in v2.0.2 and current dev (same gate).
Adds testKeyInputSanitization (trailing U+3000 / NBSP / BOM / zero-width /
internal newline → clean key; and the end-to-end classify-after-clean case).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Translate mining_tls_needs_fingerprint into de, es, fr, ja, ko, pt, ru, zh
(res/lang/*.json, 2523 → 2524 keys each), grounded per file and keeping the "TLS"
acronym. Rebuilt the CJK subset font for 2 new glyphs (书, 끈).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The chain-bootstrap download was authenticated only by a same-origin SHA-256,
which anyone who can replace the archive (CDN/server compromise or a TLS break)
can also replace. The RCE half of the original report is already closed — extract
skips every *.conf/wallet*/.dat entry, so DRAGONX.conf/blocknotify can't be
overwritten — but the archive itself was unauthenticated.
Verify a detached ed25519 signature over the published .sha256 file (the archive
is multi-GB; its checksum already binds the bytes, so signing the small checksum
authenticates the whole download) against a pinned key. A present-but-invalid
signature always fails closed; a missing one is gated by
kBootstrapRequireSignature (false until bootstrap.dragonx.is publishes .sig
files, then flip to true). Adds scripts/sign-bootstrap-release.sh; the secret key
stays offline.
Also adds regression tests: testBootstrapSignatureInterop (known-answer verify
against the pinned key, fails closed on tamper/wrong-key — F5) and
testEphemeralPortPick (F13).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
With pool TLS enabled but no fingerprint pinned, xmrig accepts ANY certificate
(verifyFingerprint passes on a null fingerprint), so an on-path attacker could
MITM the stratum session and capture/redirect the login. The wallet never set a
fingerprint and had no setting for one.
Add a pool_tls_fingerprint setting, emit it as the xmrig "tls-fingerprint" pool
key when non-empty, and refuse to start pool mining with TLS on but no
fingerprint (mining_tls_needs_fingerprint) so "pool TLS on" actually
authenticates the pool. pool_tls still defaults off.
English-only for the new string; 8 locales fall back.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The migrate-to-seed isolated node chose its RPC port by scanning a fixed
21770-21899 range for LISTEN sockets. A local co-tenant could bind() a port in
that range WITHOUT listen() — invisible to the LISTEN-state scan — get it
picked, then start a listener and intercept the isolated node's plaintext RPC,
up to returning a rogue z_getnewaddress that redirects the migration sweep.
Add EmbeddedDaemon::pickEphemeralPort(): bind 127.0.0.1:0 and return the
OS-assigned port via getsockname(). A real bind() proves the port free right now
(a bound-not-listening squatter makes it fail), and the OS-chosen number is
unpredictable, so a fixed range can't be pre-squatted. pickFreePort() uses it,
keeping the old scan only as a fallback. The port reaches disk solely in the
0600 DRAGONX.conf. A tiny close-then-bind window remains but is no longer
targetable in advance.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The chat message thread used the global 6px scrollbar with a ~6% grab, which is
thin and hard to grab. Push a 12px scrollbar with a clearly-visible,
theme-adaptive grab (OnSurface at 55/95/135 alpha for idle/hover/active) for the
##ChatMessages child only, popped after EndChild. No change to the global
scrollbar or other scroll regions.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Compact runs the node with -salvagewallet to rewrite wallet.dat, which produces
the exact same salvage signature in the daemon output as a corruption recovery.
So detectWalletAutoRecovery mistook the compaction for a recovery and raised the
alarming "Your wallet file needs a quick repair" dialog — whose "Restore
original" would have UNDONE the compaction by restoring the larger pre-compact
backup.
Flag the salvage as expected when we arm it for a compaction
(compaction_salvage_expected_, set in both compactWallet and
compactViaEmbeddedSwitch, disarmed if the restart is refused). When the detector
sees the salvage it consumes the flag and shows a calm "Wallet compacted" toast
(compact_done) instead of the recovery dialog. A genuine, unexpected salvage
still surfaces the dialog as before.
English only for compact_done (8 locales fall back). Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Translate the 4 remaining Compact strings (compact_needs_embedded,
confirm_compact_switch_msg, compact_switching, compact_switch_stop_failed) into
de, es, fr, ja, ko, pt, ru, zh (res/lang/*.json, 2519 → 2523 keys each), grounded
per file and keeping wallet.dat / dragonxd / -salvagewallet as-is. No new CJK
glyphs, so the subset font is unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When connected to an external/standalone dragonxd (the wallet adopted a running
node, so daemon_controller_ is null), Compact couldn't run. Add a path that does
it in one click: compactViaEmbeddedSwitch() gates the connect loop, drops the RPC
connection, and on the worker gracefully stops the external node (RPC "stop" with
our credentials, via stopDaemonForWalletSwitch) and waits for the port; back on
the main thread it switches the wallet to its built-in node and starts it with a
one-shot compact_on_embedded_start_ flag that arms -salvagewallet, so the fresh
node rewrites wallet.dat (and rescans). On stop failure nothing is changed and
the external node stays up.
The Compact button is now enabled whenever the build can run the embedded node;
its confirmation branches — direct compact when the wallet already runs the
built-in node (canCompactWallet), else a clear message (confirm_compact_switch_
msg) that it will stop the external node, switch to the built-in one, and that
this changes which node binary runs. New strings confirm_compact_switch_msg /
compact_switching / compact_switch_stop_failed.
Mirrors restartDaemon's disconnect + background stop pattern; controller creation
stays on the main thread. Can't be runtime-verified here (no live daemon). Build
+ tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Compact rewrites wallet.dat by restarting the node with -salvagewallet, which the
wallet can only do for the EMBEDDED node it manages. When the wallet is connected
to a dragonxd the user started themselves (use-embedded off, or it attached to an
already-running node), daemon_controller_ is null — and compactWallet() fired the
misleading "unavailable in lite build" warning even on a full-node wallet.
Now: a precise App::canCompactWallet() (full-node AND embedded AND a live
controller) disables the Compact button for an external/standalone daemon with a
tooltip, and compactWallet() refuses with an accurate message (compact_needs_
embedded) that tells the user to enable "Use embedded dragonxd" or restart their
dragonxd with -salvagewallet themselves. The lite-build path keeps its own
message. New string compact_needs_embedded (English; 8 locales fall back).
Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A consolidation batch can be rejected by the daemon with
bad-txns-shielded-requirements-not-met (REJECT_DUPLICATE) when it clashes with an
earlier, still-unconfirmed batch — the batch outran its predecessors into the
mempool. That isn't a real failure: once the earlier batches confirm, the same
merge succeeds. Previously it failed the whole address.
Now a merge OP failure whose message is a mempool conflict (shielded- /
joinsplit-requirements-not-met, txn-mempool-conflict, inputs-spent — new pure
helper isDeferrableMergeOpError) HOLDS the address for kRunMempoolClearSec (2 min)
instead of failing it, then retries from where it left off; up to
kRunMaxDeferRetries consecutive defers (reset on any success), after which it is a
genuine failure. Deferrals don't feed the halt breaker, and since the address
outcome stays non-failed the run verdict reads Clean when the retry succeeds.
applyOpState takes `now` to stamp the hold; next() waits on a deferred address
until its window passes.
Unit-tested (testConsolidationDefer): the classifier; and a driven run where an
op reports the conflict → the address is deferred (not failed), held before the
window and retried after it. Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Translate the 7 new Compact strings (wallet_size_compact, tt_wallet_size_compact,
compact_started, confirm_compact_wallet_{title,msg,safe}, compact_wallet_confirm)
and re-translate the 4 corrected consolidation strings (consolidate_desc,
wallet_size_warn, wallet_size_auto_info, tt_wallet_size_warn) into de, es, fr, ja,
ko, pt, ru, zh (res/lang/*.json, 2512 → 2519 keys each), grounded per file and
keeping wallet.dat / Berkeley DB as-is. Rebuilt the CJK subset font
(2123 → 2127 glyphs) for the five new glyphs (肥 領 + ko 써 압 켤).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The note/consolidation strings promised the wallet "shrinks" / "stays small",
but consolidation can't shrink wallet.dat (Berkeley DB never shrinks in place) —
it reduces the note count so the wallet scans faster and stops growing, and the
freed space is reclaimed only by Compact. Reword consolidate_desc,
wallet_size_warn, wallet_size_auto_info and tt_wallet_size_warn to say exactly
that (the tooltip now points at Compact). English only; the 8 locales keep their
prior translations until the next pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
The per-address list boxes (the run-progress list and the selection list) drew
their text flush against the border. The Consolidate dialog is a floating
overlay, which pops its content padding after the content child, so the ambient
WindowPadding is 0 — a bordered child therefore got no inner padding and its
rows touched the border. Push a small inner padding (10px, DPI-scaled) and
AlwaysUseWindowPadding for both lists, reserving it in their heights, so the
rows sit comfortably inset. Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The overlay dialog is auto-height and vertically centred, so it re-centers
whenever its content height changes. During a consolidation run two lines toggle
and made it jump: the pause notice (waiting for a batch gap / sync / a send),
which flickers on and off every batch, and the "run again" leftovers hint, which
appears partway through. Reserve a fixed slot for the pause notice and, while the
run is live, reserve the leftovers hint's measured height up front, so the
content height stays constant and the modal holds still. The end-of-run
transition to the result view is unchanged. Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Default the auto_consolidate setting to true, so a full-node wallet keeps its
note count down on its own out of the box (users can still turn it off). A
missing key in an older config loads the new default, enabling it on upgrade,
which is intended. The page-state mirror default matches.
Safety is unchanged and reinforced in comments: auto-consolidation reuses the
"keep in each address" engine — z_mergetoaddress [addr] -> addr — so funds NEVER
move between addresses; it only sheds notes within each address. It never uses
the "into one address" sweep. It also only runs when the wallet is idle AND
unlocked (a locked encrypted wallet never auto-runs) and only touches addresses
with more than kAutoConsolidateMinNotes notes, so a fresh or lean wallet stays
dormant. Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Audited every tooltip. The shared helper material::Tooltip wrapped ImGui's
SetTooltip with no width limit, so a long tooltip laid out on one line and
stretched across the whole display — most visible on the newly reworded
note/consolidation tooltips. 258 call sites go through this helper, so the fix is
central:
- material::Tooltip / BeginTooltip now push a text wrap position (420 logical px,
DPI-scaled) so long text wraps to a comfortable column; short text is
unaffected (it's already narrower). A caller that pushes its own wrap pos nests
cleanly. Also fixes a latent style-stack leak when ImGui::BeginTooltip returns
false (the pushed style is now popped).
Six sites bypassed the helper with raw ImGui tooltips. The two that actually
stretched are migrated to material::Tooltip: the alert/bell toast-hover showing a
full (now ~250-char) message, and the wallets dialog's folder-path hover. The
chat over-cap tooltip is migrated too for consistency. The remaining three
(two wallet-recovery dialog tips, the chat composer's parts tooltip) already
clamp via their own PushTextWrapPos and are left as-is.
Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A manual consolidation's merges compete with the GUI's routine wallet scans for
the daemon's cs_main: the run won't fire the next merge while any scan is in
flight, and because each merge mutates the wallet it re-triggers the balance /
history scans, which then delay the following merge. The WalletScanGovernor
already serializes all of these one-at-a-time under a cs_main budget, so the fix
is to pause the heavy routine streams — not every RPC — while a user run owns the
budget.
WalletScanGovernor gains per-stream routine suppression (tryAdmit returns empty
for a paused stream, which keeps waiting and resumes the instant it is unpaused;
explicit needs via beginExplicit are never paused), plus a convenience that
pauses the balance / addresses / history / recent-tx group together. App::update
pauses that group while consolidation_.active() AND the run is user-started —
an auto (background) run is left gentle and untouched, and the cheap sync / peer
/ mempool / operation-status polls keep running so sync and disconnects stay
visible. The end-of-run forced balance refresh repaints once the run finishes.
Note: a manual run is bounded (≤ maxBatches per click, ~minutes), so the balance
and recent-tx views are only briefly stale — an incoming payment shows once the
run finishes or is stopped. Unit-tested (testWalletScanGovernor): a paused stream
is not admitted but keeps waiting, explicit bypasses it, unpausing re-admits, and
chat/Adhoc are never in the paused group.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
startConsolidation reset the shared ConsolidationRun but never cleared
auto_consolidate_run_. In the rare window where a background auto cycle was torn
down by a disconnect (abort) before pumpAutoConsolidation cleared its flag, a
user-started run could inherit the stale flag and be treated as an auto cycle —
silent (no merge-done/failed toasts) and auto-dismissed. Clear the flag on a
successful manual start so a user run always keeps its own notifications and
lifecycle. No behavior change in the normal case. Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Translate the three new keys (auto_consolidate, tt_auto_consolidate,
wallet_size_auto_info) and re-translate the three reworded ones (wallet_size_warn,
tt_wallet_size_warn, consolidate_desc) into de, es, fr, ja, ko, pt, ru, zh
(res/lang/*.json, 2509 → 2512 keys each), so the "what are notes / why
consolidate" education and the auto-consolidation toggle read natively in every
language. Each was grounded in its file's existing terminology for consolidate /
transaction / fee / balance / sync / shielded, with a single consistent rendering
of the crypto term "note" per language (e.g. ru «заметка», zh 票据, witness data
见证数据).
Rebuilt the CJK subset font (NotoSansCJK-Subset.ttf, 2115 → 2123 glyphs) for the
eleven new glyphs the translations introduce (千堆巧幣悄枚溜財 + ko 띄슷였).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The large-wallet notification just said "This wallet file is large" — users who
don't know what a shielded "note" is had no idea what to do or why. The nudge now
teaches: its message explains that each payment is stored as a separate note,
that notes pile up and enlarge/slow the wallet, and that consolidating merges
them while leaving the balance unchanged. The text wraps in full in the bell/
alert panel and the Settings wallet-size banner (and shows on hover from the
ellipsized toast), and the hover tooltip adds the detail plus points at the new
Auto-consolidate toggle.
When Auto-consolidate is ON the nudge no longer stays silent — it shows a calm
one-time info (wallet_size_auto_info) telling the user the background
consolidator is already handling it, so the accumulating notes never look like an
unexplained problem. When it's OFF, the educational warning keeps its
"Consolidate notes…" action that opens the dialog.
The Consolidate dialog's own intro (consolidate_desc) is likewise expanded from a
one-liner into a plain-language explanation of what notes are and why consolidate.
English source updated; the reworded existing keys keep their prior (valid, if
terser) translations and the new wallet_size_auto_info falls back to English
pending a translation pass. Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A mining/pool wallet can accumulate tens of thousands of shielded notes, and the
manual "Consolidate" run — capped at 20 batches per address per click — needs
many re-runs to flatten a 10k+ note address. This adds a hands-off alternative:
a Settings toggle ("Auto-consolidate notes", full-node, off by default) that
trickle-merges notes in the background while the wallet is idle, so it sheds
notes over hours/days without the user ever opening the dialog.
Deliberately gentle, per the request: a small batch (15 inputs/tx vs 50 manual)
and only 3 batches per address per cycle, with cycles ~10 min apart — each cycle
is a handful of tiny merges that barely touch the node. It only acts when the
wallet is genuinely idle (walletScanReady: connected, synced, unlocked, node not
busy, not rescanning) and no send / shield / manual run is in progress, and it
goes dormant (re-scanning hourly) once every address is tidy.
Implementation reuses the existing paced services::ConsolidationRun engine in
"keep in each address" mode, so there is NO fund-path change and the run's
pacing / failure breakers / note-locking all apply:
- App::pumpAutoConsolidation (pumped from update() after pumpConsolidation):
finalizes a finished cycle (schedules the cooldown + dismisses the run so the
manual dialog never shows a stale auto result), else starts a new cycle when
idle and the cooldown has elapsed.
- postAutoConsolidationScan: a quiet z_listunspent scan (the dialog's loadScope
minus the UI state), session-guarded; on result picks candidates and starts.
- startConsolidationQuiet: the same guards as startConsolidation but silent, with
a gentle RunConfig; finishConsolidation stays silent for auto runs (logs only).
- services::autoConsolidateCandidates (pure, unit-tested): addresses above the
note floor that are worth merging; plus the gentle kAutoConsolidate* constants.
- The one-time large-wallet nudge is suppressed while auto-consolidation is on.
Settings plumbing (auto_consolidate, default false) + a daemon-gated toggle in
the Wallet tab's options, with a tooltip. Build + tests + hygiene green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Translate the five new chat strings — chat_parts_label, chat_txns_label,
chat_parts_explain, chat_parts_explain_multi, chat_receiving_large — into de, es,
fr, ja, ko, pt, ru, zh (res/lang/*.json, 2504 → 2509 keys each), additively and
matching each file's existing terminology for transaction / fee / message. The
transaction abbreviation uses each locale's natural short form (Tx / tx / 件 /
건 / транз. / 笔).
Rebuilt the CJK subset font (NotoSansCJK-Subset.ttf, 2111 → 2115 glyphs) for the
four new glyphs the translations introduce (产 割 拆 in zh, 뉩 in ko) so they
render instead of tofu.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Until now an incoming large message was invisible until every part landed.
ChatService::pendingLargeMessages() exposes the in-progress tier-3 receives
(conversation, chunks gathered / chunks needed) from the reassembly buffer, and
the chat tab renders a subtle centred line below the thread — "Receiving a large
message… 24 / 36 parts" — that updates each scan and disappears when the message
completes and surfaces as an ordinary bubble. A complete-but-withheld (sensitive
vault locked) group is not reported as incoming.
New string chat_receiving_large (English; 8 locales fall back). Unit test extended:
after the first slice the receive is reported in progress; after the whole message
arrives it is no longer pending.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Front end of tier-3 larger messages. The composer body cap goes from 4000 to
16000 bytes (kHushChatMaxMessageChunks = 64 chunks ⇒ up to 4 transactions), so a
message past the single-transaction ceiling now actually composes and sends via
the tier-3 path. The buffer and static_assert grow to match.
The beside-the-gauge indicator (and its hover tooltip) now distinguish the two
tiers: while a long message still fits one transaction it shows the part count as
before; once it spills across several it shows the TRANSACTION count — the real
cost the user asked to see — and the tooltip explains it is split across several
transactions, the recipient sees it only once every part has arrived, so it takes
longer to deliver and costs a fee per transaction. New strings chat_txns_label /
chat_parts_explain_multi (English; 8 locales fall back pending a translation pass).
Tier 3 is now end to end: compose → split → broadcast → reassemble → display.
A receive-side "incoming N/M parts" progress hint remains a future refinement
(an incomplete large message simply appears once whole).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Send side of tier-3 larger messages. sendChatMessage now composes via
composeMessageParts (splitOutgoingMessage), which returns one OutgoingChatMemos
per transaction, and enqueues each on the existing note-buffer coordinator — so
the parts drain sequentially against verified notes exactly like ordinary chat
sends, with no fund-path change (each part is the same pinned 0-value
chatSendOutputs z_sendmany).
A single echo bubble represents the whole message. A new per-echo outstanding-
part counter holds it at "Sending" until the LAST part is broadcast, then flips
it to Sent; if any part hits a hard failure the remaining queued parts are purged
(a message missing a slice can never reassemble, so sending the rest only wastes
fees) and the whole message is failed once — its existing Retry recomposes and
re-splits from the body. A transient-funds deferral still retries the part in
place. The counter map is cleared alongside the send queue on a wallet reset.
Inert until the composer cap is raised (the current 4000-char cap yields a
single tier-2 transaction); that + the multi-transaction composer indicator land
next. Build + tests green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Second half of tier-3 larger messages: the receive side. ChatService now buffers
the slices of a multi-transaction message (keyed by the shared message id) as
they arrive — across transactions and across scans — and reassembles the whole
ciphertext once every chunk is present, then decrypts and surfaces it as one
message. The buffer is NOT persisted: a rescan re-sends every slice, so it
re-derives from chain exactly like the control reducer, and survives a restart
mid-receive (the next full scan re-feeds the siblings and completes it).
Ingest's per-message build/decrypt/guard logic is refactored into one shared
lambda so a reassembled tier-3 message passes the identical block / on-chain-hide
/ sensitive-vault / tombstone checks as a single-tx message. A completed group is
retired after it surfaces (deduped across scans by its stable canonical txid —
the smallest sibling txid); a group withheld only because the sensitive vault is
locked is kept so a later unlock + scan completes it. Our own slices (sender ==
us) are skipped — the local echo records the outgoing message. The pending map is
bounded (256 groups) against a flood of never-completing partials.
Unit-tested (testHushChatTier3Reassembly): a ~9000-char message's first slice
alone surfaces nothing; once every slice has arrived it reassembles, decrypts to
the original and surfaces once; a re-scan dedups; our own slices never ingest.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Foundation for messages too large for a single transaction (tier 2's 16-output
ceiling, ~4000 chars). A long message is now split across SEVERAL transactions
that share a random message id; each carries a slice of the one ciphertext with
GLOBAL chunk indices, and the receiver reassembles across the siblings.
Protocol: the Message header gains an optional "mid" (message id); "n" is reused
as the TOTAL chunk count and its bound raised to kHushChatMaxMessageChunks (64 ⇒
up to ~16 KB / 4 txs, tunable, ≤256 for the 2-hex index). The grouper, when a
tx's header carries "mid", emits a PARTIAL (its global-indexed chunks + message
id + total) instead of reassembling in-place; HushChatTransactionMetadata
carries those partials through. Crypto is untouched — one secretstream session
for the whole message, chunking is transport-only.
Compose: splitOutgoingMessage() returns one OutgoingChatMemos per transaction
(one element = the classic tier-1/2 single tx, byte-identical; several = tier 3).
buildOutgoingMessage (single-tx) is unchanged. Old clients bound "n" to 16 so a
tier-3 header fails to parse and its memos are dropped — graceful degradation.
Unit-tested (testHushChatLargeMessageTier3): a ~9000-char message splits into 3
txs, every output shuffled, slices gathered across siblings, reassembled and
decrypted back to the original; short message stays single-tx (no mid); the
total-chunk cap is enforced. The stateful accumulator (persisted, confirm-gated),
sequential broadcast, and progressive/incomplete UI follow in later commits.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A larger message (tier 2) is carried as one transaction split across up to 16
memo outputs, but the composer gave no sign of that. It now shows the part
count beside the byte gauge the moment the body spans more than one memo output
(computed the same way buildOutgoingMessage chunks it), and the gauge's hover
tooltip adds the count plus "sent as one transaction split into these memo
parts — it arrives as quickly as a normal message" (the honest answer: it's one
atomic 0-conf tx, not N transactions — multi-transaction splitting is the
unbuilt tier 3). New strings chat_parts_label / chat_parts_explain (English;
8 locales fall back).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
getFileSize used stat(), whose st_size is a 32-bit signed _off_t on mingw/
Windows, so a wallet.dat over 2 GiB overflowed negative and cast to a garbage
~2^64 value — the "Wallet Size: 17179869182.10 GB" (≈ 2^34 GiB) seen on a real
~2.1 GB shielded wallet, which also spuriously fired the "wallet is large"
banner. Switch to std::filesystem::file_size (portable 64-bit uintmax_t) with
the error_code overload, returning 0 on failure (missing / unreadable / a
Windows sharing violation while the daemon holds the file open) so the callers'
existing `> 0` guards fall back to "unknown". The size now reports correctly,
and the large-wallet warning fires on the real size (so a genuinely bloated
2+ GiB wallet is flagged, as intended).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds a dev-only harness that closes the "needs a live daemon" gap for the new
chat wire paths, fund-safely on an isolated regtest chain:
- tools/chat_regtest_smoke.cpp (+ an EXCLUDE_FROM_ALL CMake target): a small
driver linking the chat library — derive identity / compose a message or a
Control memo / extract + decrypt harvested memos. Secret-safe.
- tools/chat_regtest.py: starts a throwaway regtest dragonxd (own datadir,
-regtest, no network — nothing touches ~/.hush), funds a shielded note, then
drives a full round-trip through the real daemon: compose -> z_sendmany the
memo outputs -> mine -> z_listreceivedbyaddress -> feed back to the driver.
Verified on dragonxd v1.3.0: a chunked 1529-byte message (8 memo outputs in one
tx) and a self-addressed Control(del) memo both round-trip verbatim and
reassemble/extract correctly — i.e. the real node accepts a multi-output 0-value
chat tx and returns its memos intact. Paths are env-overridable
(DRAGONX_REGTEST_DAEMON_DIR / DRAGONX_CHAT_SMOKE / DRAGONX_REGTEST_RUN).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The one remaining English-only chat string (the "message too long" toast from
the larger-messages composer cap) is now translated into de/es/fr/pt/ru/zh/ja/ko
(2503 -> 2504 keys each), consistent with each file's terminology and formality.
No new CJK glyphs — all covered by the existing subset font.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>