diff options
author | Jakob Borg <jakob@nym.se> | 2014-08-31 13:48:43 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-08-31 13:48:43 +0200 |
commit | cf1bfdfb619f9ed9b59de1cf1bef9779fbea7f10 (patch) | |
tree | 7ad97e4732a83338474c55e6daec8fd1bb4d08ea | |
parent | 75b26513e10f3fa768e3de135eba2798cb26fbc8 (diff) |
Hold rmut read lock when looking at nodeStatRefs
-rw-r--r-- | model/model.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/model/model.go b/model/model.go index fc247d2cfd..2c629b1e84 100644 --- a/model/model.go +++ b/model/model.go @@ -209,9 +209,11 @@ func (m *Model) ConnectionStats() map[string]ConnectionInfo { // Returns statistics about each node func (m *Model) NodeStatistics() map[string]stats.NodeStatistics { var res = make(map[string]stats.NodeStatistics) + m.rmut.RLock() for _, node := range m.cfg.Nodes { res[node.NodeID.String()] = m.nodeStatRefs[node.NodeID].GetStatistics() } + m.rmut.RUnlock() return res } |