mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
gui: Throttle GUI update pace when -reindex
Co-authored-by: Barry Deeney <mxaddict@codedmaster.com> Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
This commit is contained in:
@@ -242,8 +242,9 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, int heig
|
|||||||
clientmodel->cachedBestHeaderHeight = height;
|
clientmodel->cachedBestHeaderHeight = height;
|
||||||
clientmodel->cachedBestHeaderTime = blockTime;
|
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
|
//pass an async signal to the UI thread
|
||||||
bool invoked = QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
|
bool invoked = QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
|
||||||
Q_ARG(int, height),
|
Q_ARG(int, height),
|
||||||
|
|||||||
Reference in New Issue
Block a user