Skip to content

Commit

Permalink
gui: Throttle GUI update pace when -reindex
Browse files Browse the repository at this point in the history
Summary:
```
With this PR, the GUI does not freeze when a user runs:

$ ./src/qt/bitcoin-qt -reindex
```

Backport of core [[bitcoin/bitcoin#18121 | PR18121]].

Test Plan:
  ninja all check

  ./src/qt/bitcoin-qt -reindex
Check the GUI sync progress no longer causes epileptic seizure to the
user.

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D8323
  • Loading branch information
hebasto authored and Fabcien committed Nov 9, 2020
1 parent 4f52ac8 commit cb55c4f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qt/clientmodel.cpp
Expand Up @@ -232,9 +232,9 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync,
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 ||
// 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(
Expand Down

0 comments on commit cb55c4f

Please sign in to comment.