Skip to content

Commit c9fe612

Browse files
hebastomxaddictryanofsky
committed
gui: Throttle GUI update pace when -reindex
Co-authored-by: Barry Deeney <[email protected]> Co-authored-by: Russell Yanofsky <[email protected]>
1 parent 98264e2 commit c9fe612

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/qt/clientmodel.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,9 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig
242242
clientmodel->cachedBestHeaderHeight = height;
243243
clientmodel->cachedBestHeaderTime = blockTime;
244244
}
245-
// if we are in-sync or if we notify a header update, update the UI regardless of last update time
246-
if (fHeader || !initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
245+
246+
// During initial sync, block notifications, and header notifications from reindexing are both throttled.
247+
if (!initialSync || (fHeader && !clientmodel->node().getReindex()) || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
247248
//pass an async signal to the UI thread
248249
bool invoked = QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
249250
Q_ARG(int, height),

0 commit comments

Comments
 (0)