diff options
| author | Wladimir J. van der Laan <[email protected]> | 2014-04-22 10:01:35 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2014-04-22 13:35:37 +0200 |
| commit | 2bbecc84e2f2969e5649fdaeb1a0ca239b03fe44 (patch) | |
| tree | 31d5a8fb1e30587cdca82618cf17de127d61ee2c /src/qt/clientmodel.cpp | |
| parent | Merge pull request #4048 from sipa/nobigb58 (diff) | |
| parent | Solve chainActive-related locking issues (diff) | |
| download | discoin-2bbecc84e2f2969e5649fdaeb1a0ca239b03fe44.tar.xz discoin-2bbecc84e2f2969e5649fdaeb1a0ca239b03fe44.zip | |
Merge pull request #4058
55a1db4 Solve chainActive-related locking issues (Wladimir J. van der Laan)
e07c943 Add AssertLockHeld for cs_main to ChainActive-using functions (Wladimir J. van der Laan)
Diffstat (limited to 'src/qt/clientmodel.cpp')
| -rw-r--r-- | src/qt/clientmodel.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index cb832fdd4..287296644 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -55,6 +55,7 @@ int ClientModel::getNumConnections(unsigned int flags) const int ClientModel::getNumBlocks() const { + LOCK(cs_main); return chainActive.Height(); } @@ -76,6 +77,7 @@ quint64 ClientModel::getTotalBytesSent() const QDateTime ClientModel::getLastBlockDate() const { + LOCK(cs_main); if (chainActive.Tip()) return QDateTime::fromTime_t(chainActive.Tip()->GetBlockTime()); else @@ -84,6 +86,7 @@ QDateTime ClientModel::getLastBlockDate() const double ClientModel::getVerificationProgress() const { + LOCK(cs_main); return Checkpoints::GuessVerificationProgress(chainActive.Tip()); } |