diff --git a/src/app.cpp b/src/app.cpp index c2b4db2..f074bc6 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -752,6 +752,21 @@ void App::update() line.find("Rescan complete") != std::string::npos) { finished = true; } + + // This daemon prints no "Done rescanning" line; instead it logs the rescan + // benchmark timing exactly when the scan finishes, e.g.: + // "... rescan 16760577ms" + // Match the lowercase " rescan " bench category ending in "ms" (the + // progress lines are "Still rescanning"/"Rescanning...", which never end in ms). + if (line.find(" rescan ") != std::string::npos) { + std::string t = line; + while (!t.empty() && (t.back() == '\r' || t.back() == '\n' || t.back() == ' ')) + t.pop_back(); + if (t.size() >= 3 && t.compare(t.size() - 2, 2, "ms") == 0 && + std::isdigit(static_cast(t[t.size() - 3]))) { + finished = true; + } + } } // Return callback to apply results on main thread @@ -761,10 +776,15 @@ void App::update() ui::Notifications::instance().success("Blockchain rescan complete"); } state_.sync.rescanning = false; + rescan_confirmed_active_ = false; state_.sync.rescan_progress = 1.0f; state_.sync.rescan_status.clear(); } else if (foundRescan) { state_.sync.rescanning = true; + // Reading "Still rescanning" straight from the daemon log is hard proof the + // rescan is genuinely running — confirm it so the getrescaninfo poll's + // completion check can fire even if it never caught a warmup error. + rescan_confirmed_active_ = true; if (rescanPct > 0.0f) { state_.sync.rescan_progress = rescanPct / 100.0f; }