feat: blockchain rescan via daemon restart + status bar progress

- Fix z_importwallet to use full path instead of filename only
- Add rescanBlockchain() method that restarts daemon with -rescan flag
- Track rescan progress via daemon output parsing and getrescaninfo RPC
- Display rescan progress in status bar with animated indicator when starting
- Improve dark theme card contrast: lighter surface-variant, tinted borders, stronger rim-light
This commit is contained in:
2026-02-28 15:06:35 -06:00
parent f5378a55ed
commit 1a5c4e8744
42 changed files with 1113 additions and 687 deletions

View File

@@ -318,6 +318,12 @@ bool EmbeddedDaemon::start(const std::string& binary_path)
for (const auto& cat : debug_categories_) {
args.push_back("-debug=" + cat);
}
// Add -rescan flag if requested (one-shot)
if (rescan_on_next_start_.exchange(false)) {
DEBUG_LOGF("[INFO] Adding -rescan flag for blockchain rescan\n");
args.push_back("-rescan");
}
if (!startProcess(daemon_path, args)) {
DEBUG_LOGF("[ERROR] Failed to start dragonxd process: %s\\n", last_error_.c_str());

View File

@@ -152,6 +152,12 @@ public:
void setDebugCategories(const std::set<std::string>& cats) { debug_categories_ = cats; }
const std::set<std::string>& getDebugCategories() const { return debug_categories_; }
/**
* @brief Request a blockchain rescan on the next daemon start
*/
void setRescanOnNextStart(bool v) { rescan_on_next_start_ = v; }
bool rescanOnNextStart() const { return rescan_on_next_start_.load(); }
/** Get number of consecutive daemon crashes (resets on successful start or manual reset) */
int getCrashCount() const { return crash_count_.load(); }
/** Reset crash counter (call on successful connection or manual restart) */
@@ -189,6 +195,7 @@ private:
std::atomic<bool> should_stop_{false};
std::set<std::string> debug_categories_;
std::atomic<int> crash_count_{0}; // consecutive crash counter
std::atomic<bool> rescan_on_next_start_{false}; // -rescan flag for next start
};
} // namespace daemon