fix(ui): stop spurious "Blockchain rescan complete" toast after restoring from minimize
While minimized the main loop skips the frame body (SDL_Delay+continue), so App::update() — which drains the daemon output via outputSince(daemon_output_offset_) — never runs and the offset isn't advanced. On restore the whole accumulated backlog is parsed in one batch: a background witness rebuild's progress lines (parsed as a rescan → state_.sync.rescanning=true) AND its "rebuilt … in Xms" completion (parsed as finished) arrive together and fire "Blockchain rescan complete" for a scan the user never initiated. On WINDOW_RESTORED, discard the daemon-output backlog (advance the offset to the current end, via App::skipDaemonOutputBacklog) before the resumed update parses it — so only new output is parsed. Genuine user-initiated rescans still surface completion via the getrescaninfo monitor. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+12
@@ -5047,6 +5047,18 @@ void App::refreshNow()
|
||||
invalidateShieldedHistoryScanProgress(true);
|
||||
}
|
||||
|
||||
void App::skipDaemonOutputBacklog()
|
||||
{
|
||||
// While minimized, App::update() is paused, so daemon_output_offset_ is never advanced and a large
|
||||
// backlog of daemon output piles up. Parsing it all at once on restore would replay a background
|
||||
// witness rebuild's progress + completion in a single batch and fire a spurious "Blockchain rescan
|
||||
// complete" toast. Advance the offset to the current end so only NEW (post-restore) output is parsed.
|
||||
// A genuine user-initiated rescan still surfaces completion via the getrescaninfo monitor.
|
||||
if (daemon_controller_ && daemon_controller_->isRunning()) {
|
||||
(void)daemon_controller_->outputSince(daemon_output_offset_); // advances daemon_output_offset_ to the end
|
||||
}
|
||||
}
|
||||
|
||||
void App::handlePaymentURI(const std::string& uri)
|
||||
{
|
||||
auto payment = util::parsePaymentURI(uri);
|
||||
|
||||
Reference in New Issue
Block a user