feat(wallet): wallet-files list + switching (P2)
Second phase of multi-wallet: list wallet files and switch the active one. - Daemon plumbing: EmbeddedDaemon::setWalletFile -> start() passes -wallet=<name> (non-default only; skipped during the isolated seed-migration start), and DaemonController::syncSettings pushes active_wallet_file on each start. - App::switchToWallet: persist the new active wallet, then stop + restart the node on -wallet=<name> (rescan only if it was never synced in this datadir). Reuses the seed-adopt restart coordination; WalletState clears on disconnect and the P1 identity-scoped caches re-key, so no previous-wallet data leaks. Guarded: full-node, embedded daemon, not mid-restart, no pending send. - Wallets dialog (Settings -> Backup & Data -> "Wallets…"): a table of wallet files (datadir wallet*.dat + user-added folders' *.dat) with size (disk) and cached balance / address count / last-opened (wallet index), a current/Active badge, Open (switch), and Add folder. Out-of-datadir wallets show "import to open" (P3). Added as a sweep surface. - Mining payout safety: non-destructive warning if the pool-mode worker looks like a DragonX address not in the current wallet (stale after a switch). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -277,6 +277,23 @@ static void RenderMiningTabContent(App* app)
|
||||
RenderMiningModeToggle(app, state, mining, dl, capFont, ovFont, dp, hs, gap, availWidth,
|
||||
s_pool_mode, s_pool_url, s_pool_worker, s_pool_settings_dirty);
|
||||
|
||||
// Payout safety (multi-wallet): in pool mode, warn if the worker looks like a DragonX address
|
||||
// that isn't in the CURRENT wallet — e.g. left over from a wallet you switched away from, so
|
||||
// rewards would land in the wrong wallet. Non-destructive: we only warn, never overwrite (it
|
||||
// could be a deliberate external payout).
|
||||
if (s_pool_mode) {
|
||||
std::string w(s_pool_worker);
|
||||
while (!w.empty() && (w.front()==' '||w.front()=='\t'||w.front()=='\n'||w.front()=='\r')) w.erase(w.begin());
|
||||
while (!w.empty() && (w.back()==' '||w.back()=='\t'||w.back()=='\n'||w.back()=='\r')) w.pop_back();
|
||||
const bool looksLikeAddr = w.size() > 10 && (w.rfind("zs", 0) == 0 || w[0] == 'R');
|
||||
bool inWallet = false;
|
||||
for (const auto& a : state.addresses) if (a.address == w) { inWallet = true; break; }
|
||||
if (looksLikeAddr && !inWallet && !state.addresses.empty()) {
|
||||
ImGui::Dummy(ImVec2(0, gap));
|
||||
Type().textColored(TypeStyle::Caption, Warning(), TR("mining_payout_foreign"));
|
||||
}
|
||||
}
|
||||
|
||||
// ================================================================
|
||||
// CONTROLS — Glass card with CPU core grid (no heading)
|
||||
// ================================================================
|
||||
|
||||
Reference in New Issue
Block a user