diff options
| author | Cozz Lovan <[email protected]> | 2014-08-10 02:28:23 +0200 |
|---|---|---|
| committer | Cozz Lovan <[email protected]> | 2014-08-10 02:28:23 +0200 |
| commit | 9297763dadeee2fc74fcbbbf8eb227e4930877f1 (patch) | |
| tree | e113a1adf2202b033f7ca46c8da71d7caaf62bd4 /src/qt/peertablemodel.cpp | |
| parent | Merge branch 'patch-4' of git://github.com/benhc123/bitcoin into merge-PR4653 (diff) | |
| download | discoin-9297763dadeee2fc74fcbbbf8eb227e4930877f1.tar.xz discoin-9297763dadeee2fc74fcbbbf8eb227e4930877f1.zip | |
[Qt] Add TRY_LOCK back to peertablemodel
Diffstat (limited to 'src/qt/peertablemodel.cpp')
| -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 54b46867e..cfa05300c 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) |