feat(lite): auto-open existing wallet on startup + gate full-node RPC refreshes

Auto-open: on the first update() tick (kept off init() so a slow
initialize_existing network call can't freeze startup before the window), if a
wallet file exists, open it. initialize_existing needs no passphrase — it loads
the file; a previously-synced + saved wallet resumes from its height (fast)
instead of rescanning from the checkpoint. Adds LiteWalletController::walletExists()
(bridge.walletExists on the connection's chain) + a chainName_ member.

RPC-refresh gating: the earlier connected=walletOpen() fix (so the wallet UI is
enabled in lite) had a side effect — the full-node periodic + per-page RPC
refreshes (mining/balance/peers/txs, and setCurrentPage's immediate refresh)
gate on state_.connected, so they began firing in lite and failing
("X error: Not connected"). Re-gate those on ACTUAL RPC connectivity
(rpc_ && rpc_->isConnected()) instead of the lite proxy. Full-node is unchanged
(state_.connected ⟺ rpc connected there); lite no longer issues any RPC.

Runtime-verified in WSLg with a pre-seeded wallet: app auto-opens (Starting
Mempool + sync begins), and "Not connected" / getMiningInfo / RPC-connect noise
all drop to 0 — a fully clean lite run. tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 16:29:27 -05:00
parent 89bd21018a
commit 76c2ac5db8
5 changed files with 39 additions and 6 deletions

View File

@@ -565,8 +565,10 @@ void App::setCurrentPage(ui::NavPage page)
applyRefreshPolicy(page);
using RefreshTimer = services::NetworkRefreshService::Timer;
// Immediate refresh for the incoming tab's priority data
if (state_.connected && !state_.isLocked()) {
// Immediate refresh for the incoming tab's priority data. Gate on ACTUAL RPC connectivity
// (not state_.connected, which is the lite "online" proxy) — lite has no RPC daemon and the
// lite controller refreshes wallet data itself, so these full-node RPC polls must not fire.
if (rpc_ && rpc_->isConnected() && !state_.isLocked()) {
using NP = ui::NavPage;
switch (page) {
case NP::Overview: