perf(net): one balance scan per poll, filtered opstatus, a guarded merge scope

The Core poll ran z_gettotalbalance twice (minconf 0 and 1), each a whole-
wallet scan under dragonxd's cs_main. The spendable (minconf=1) call now
runs only after the display call succeeded, and only when something is
unconfirmed or pending or the exact total moved: about 95% of polls make
one scan instead of two. A forced post-send balance can no longer be lost
to a refused enqueue, and pending-send debits aren't re-applied each tick.

z_getoperationstatus is filtered to our opids with its real argument form
([[id,...]]; the old ["id"] was rejected), falling back to the unfiltered
call if a daemon refuses the filter. The Shield/Merge dialog's own polls
are filtered and session-guarded too, and finally reach Done; the dead
RPCClient wrappers are deleted.

The Merge/Consolidate scope scan becomes a tested state machine: one scan
at a time, failures latch behind a Retry button, only "node not ready"
retries by itself (10/30/60 s, at most 3), Lite never scans. Its 120 s
calls are maintenance calls: every main-thread disconnect aborts one in
flight first, so a lifecycle action no longer freezes the UI behind it.
An aborted merge that was already sent says it may still go through.

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 4eed4283d6
commit 8b9a498eee
23 changed files with 1044 additions and 128 deletions
+9 -6
View File
@@ -1293,12 +1293,15 @@ void RenderSettingsPage(App* app) {
if (BTN("##wreq", TR("settings_request_payment"), ICON_MD_QR_CODE))
RequestPaymentDialog::show();
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_request_payment"));
if (BTN("##wshield", TR("settings_shield_mining"), ICON_MD_SHIELD))
ShieldDialog::show(ShieldDialog::Mode::ShieldCoinbase);
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_shield_mining"));
if (BTN("##wmerge", TR("settings_merge_to_address"), ICON_MD_CALL_MERGE))
ShieldDialog::showMerge();
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_merge"));
// z_shieldcoinbase / z_mergetoaddress are full-node RPCs: Lite has no node to send them to.
if (app->supportsFullNodeLifecycleActions()) {
if (BTN("##wshield", TR("settings_shield_mining"), ICON_MD_SHIELD))
ShieldDialog::show(ShieldDialog::Mode::ShieldCoinbase);
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_shield_mining"));
if (BTN("##wmerge", TR("settings_merge_to_address"), ICON_MD_CALL_MERGE))
ShieldDialog::showMerge();
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_merge"));
}
if (BTN("##wclear", TR("settings_clear_ztx"), ICON_MD_DELETE_SWEEP))
s_settingsState.confirm_clear_ztx = true;
if (ImGui::IsItemHovered()) material::Tooltip("%s", TR("tt_clear_ztx"));