aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-08-11 15:06:39 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-08-11 15:06:43 +0200
commit3e089a00e780c193bb1528195828d4d320fb3deb (patch)
tree7c0e4a1c0d52c4e783dafdd3f3811ec72cca5bad /src
parent85af3856e7330b4fcb79f1756438bbfa827a196b (diff)
parent9297763dadeee2fc74fcbbbf8eb227e4930877f1 (diff)
Merge pull request #4668
9297763 [Qt] Add TRY_LOCK back to peertablemodel (Cozz Lovan)
Diffstat (limited to 'src')
-rw-r--r--src/qt/peertablemodel.cpp10
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)