Skip to content

Commit 4c97eb5

Browse files
fix(qt): reset splash progress bar on multi-wallet rescans
When multiple wallets rescan at startup, each emits ShowProgress with a wallet-name-prefixed message (e.g. '[wallet2] Rescanning…'). Since these map to the same PhaseInfo entry, the phase \!= m_current_phase guard skipped reinitialization for subsequent wallets. Track the triggering message text and also reinitialize resetsBar phases when the message changes.
1 parent 938f517 commit 4c97eb5

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/qt/splashscreen.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,14 @@ void SplashScreen::showMessage(const QString &message, int alignment, const QCol
357357
// Look up the phase range for this message; only reinitialize when the
358358
// phase actually changes so that repeated progress callbacks (e.g. during
359359
// wallet rescans) don't reset displayProgress and phaseTimer each time.
360+
// For resetsBar phases, also reinitialize when the message text changes
361+
// (e.g. different wallet name prefix during multi-wallet rescans).
360362
const PhaseInfo* phase = LookupPhase(message);
361-
if (phase != nullptr && phase != m_current_phase) {
363+
const bool phase_changed = phase != nullptr &&
364+
(phase != m_current_phase || (phase->resetsBar && message != m_current_phase_message));
365+
if (phase_changed) {
362366
m_current_phase = phase;
367+
m_current_phase_message = message;
363368
if (phase->snapsToEnd) {
364369
// Final phase: snap to 100% immediately since the splash
365370
// will be destroyed moments after "Done loading" arrives

src/qt/splashscreen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public Q_SLOTS:
7676
bool phaseIsLong{false}; // True for long independent phases (rescan, wallet load)
7777
QElapsedTimer phaseTimer; // Time since current phase started
7878
const struct PhaseInfo* m_current_phase{nullptr}; // Current phase (defined in splashscreen.cpp)
79+
QString m_current_phase_message; // Message that triggered current phase
7980
qreal displayProgress{0.0}; // Smoothly animated display value (0.0-1.0)
8081
QTimer animTimer;
8182

0 commit comments

Comments
 (0)