mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-21 14:34:49 +01:00
Merge #18121: gui: Throttle GUI update pace when -reindex
c9fe61291e
gui: Throttle GUI update pace when -reindex (Hennadii Stepanov) Pull request description: This is grabbed from #17565. All **laanwj**'s and **ryanofsky**'s suggestions are implemented. With this PR, the GUI does not freeze when a user runs: ``` $ ./src/qt/bitcoin-qt -reindex ``` ACKs for top commit: jonasschnelli: utACKc9fe61291e
Tree-SHA512: c7be316cb73d3d286bdf8429a960f71777d13a73d059869a64e23ad276499252b561a3a5b9613c4c1ad58cc0de26283c1ec72be745c401f604eaa05f70bf7d64
This commit is contained in:
commit
0c20809da8
1 changed files with 3 additions and 2 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Reference in a new issue