diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-11 15:06:39 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-11 15:06:43 +0200 |
commit | 3e089a00e780c193bb1528195828d4d320fb3deb (patch) | |
tree | 7c0e4a1c0d52c4e783dafdd3f3811ec72cca5bad /src/qt | |
parent | 85af3856e7330b4fcb79f1756438bbfa827a196b (diff) | |
parent | 9297763dadeee2fc74fcbbbf8eb227e4930877f1 (diff) |
Merge pull request #4668
9297763 [Qt] Add TRY_LOCK back to peertablemodel (Cozz Lovan)
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/peertablemodel.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/qt/peertablemodel.cpp b/src/qt/peertablemodel.cpp index 54b46867ea..cfa05300cf 100644 --- a/src/qt/peertablemodel.cpp +++ b/src/qt/peertablemodel.cpp @@ -75,8 +75,14 @@ public: } // Try to retrieve the CNodeStateStats for each node. - BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) - stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats); + { + TRY_LOCK(cs_main, lockMain); + if (lockMain) + { + BOOST_FOREACH(CNodeCombinedStats &stats, cachedNodeStats) + stats.fNodeStateStatsAvailable = GetNodeStateStats(stats.nodeStats.nodeid, stats.nodeStateStats); + } + } if (sortColumn >= 0) // sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily) |