-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Context
PR #642 introduced a platform_sync_info cache on WalletsBalancesScreen to avoid DB reads every frame for the sync status panel. The cache is refreshed in select_hd_wallet() and two display_task_result() handlers.
Problem
Several code paths assign self.selected_wallet directly without going through select_hd_wallet(), which means platform_sync_info is not refreshed:
update_selected_wallet_for_network()(lines 288, 309) — fallback wallet selection after network switch- Wallet removal handler (line 716) — selecting next wallet after removing current
refresh_on_arrival()(line 2239) — auto-selecting first wallet when none selected
This can leave stale sync status data displayed for the wrong wallet.
Proposed Solution
Create a centralized set_selected_hd_wallet(&mut self, wallet: Option<Arc<RwLock<Wallet>>>) helper that:
- Sets
self.selected_wallet - Clears
self.selected_account - Persists the wallet hash
- Refreshes
platform_sync_infocache
Replace all direct assignments to self.selected_wallet with calls to this helper.
References
- PR backport: feat(ui): add sync status panel to wallet screen #642 review comment: https://github.com/dashpay/dash-evo-tool/pull/642/files#r2851751993
- Affected file:
src/ui/wallets/wallets_screen/mod.rs
🤖 Filed by Claudius the Magnificent AI Agent
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels