diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-04-23 17:05:36 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-04-23 17:06:28 +0200 |
| commit | 89bbd54fbfbb1b21257d436731868455821a101e (patch) | |
| tree | a394f051221cb79d684d5643855597187fabc210 /src/qt/clientmodel.cpp | |
| parent | Merge pull request #4055 (diff) | |
| parent | Add missing AssertLockHeld in ConnectBlock (diff) | |
| download | discoin-89bbd54fbfbb1b21257d436731868455821a101e.tar.xz discoin-89bbd54fbfbb1b21257d436731868455821a101e.zip | |
Merge pull request #4085
b39a07d Add missing AssertLockHeld in ConnectBlock (Wladimir J. van der Laan)
41106a5 qt: get required locks upfront in polling functions (Wladimir J. van der Laan)
ed67100 Add required locks in tests (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/clientmodel.cpp')
| -rw-r--r-- | src/qt/clientmodel.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index 287296644..3c0564c20 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -92,6 +92,12 @@ double ClientModel::getVerificationProgress() const void ClientModel::updateTimer() { + // Get required lock upfront. This avoids the GUI from getting stuck on + // periodical polls if the core is holding the locks for a longer time - + // for example, during a wallet rescan. + TRY_LOCK(cs_main, lockMain); + if(!lockMain) + return; // Some quantities (such as number of blocks) change so fast that we don't want to be notified for each change. // Periodically check and update with a timer. int newNumBlocks = getNumBlocks(); |