aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-02-11 22:34:59 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-02-12 23:51:41 +0200
commitc9fe61291e9b23f37cf66194c2dad28e4d4a8954 (patch)
tree6b54f8e71b818a22861fc2162d5a12d3fe0e5f1b /src/qt
parent98264e2ccb177a6603fe957f7e263fb413b50d04 (diff)
downloadbitcoin-c9fe61291e9b23f37cf66194c2dad28e4d4a8954.tar.xz
gui: Throttle GUI update pace when -reindex
Co-authored-by: Barry Deeney <mxaddict@codedmaster.com> Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/clientmodel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp
index e8146982f9..a1ec3eaab1 100644
--- a/src/qt/clientmodel.cpp
+++ b/src/qt/clientmodel.cpp
@@ -242,8 +242,9 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig
clientmodel->cachedBestHeaderHeight = height;
clientmodel->cachedBestHeaderTime = blockTime;
}
- // if we are in-sync or if we notify a header update, update the UI regardless of last update time
- if (fHeader || !initialSync || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
+
+ // During initial sync, block notifications, and header notifications from reindexing are both throttled.
+ if (!initialSync || (fHeader && !clientmodel->node().getReindex()) || now - nLastUpdateNotification > MODEL_UPDATE_DELAY) {
//pass an async signal to the UI thread
bool invoked = QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
Q_ARG(int, height),