// DragonX Wallet - ImGui Edition // Copyright 2024-2026 The Hush Developers // Released under the GPLv3 // // Pure decision for what to do when the Settings bootstrap worker finishes (C221). #pragma once #include "../../util/bootstrap.h" namespace dragonx { namespace ui { struct BootstrapCompletion { enum class Next { Pending, Done, Failed }; Next next = Next::Pending; bool markRescan = false; // completed: reconcile the preserved wallet.dat against the new chain bool releaseGate = false; // dialog not open: clear App::bootstrap_downloading_ ourselves bool toast = false; // dialog not open (and not a user cancel): tell the user the outcome }; inline BootstrapCompletion resolveBootstrapCompletion(bool workerDone, util::Bootstrap::State state, bool dialogOpen, bool userCancelled) { BootstrapCompletion c; if (!workerDone) return c; const bool ok = (state == util::Bootstrap::State::Completed); c.next = ok ? BootstrapCompletion::Next::Done : BootstrapCompletion::Next::Failed; c.markRescan = ok; c.releaseGate = !dialogOpen; c.toast = !dialogOpen && !userCancelled; return c; } } // namespace ui } // namespace dragonx