From 201a814459429e9b1f558c0d5ddcd31ce568c390 Mon Sep 17 00:00:00 2001 From: yacovm Date: Thu, 27 Jul 2017 14:58:25 +0300 Subject: [PATCH] [FAB-5498] Missing RLock in onStatusChangeFactory There is a map access that isn't protected by a lock that was introduced in a recent commit. Change-Id: I31f884f76aaf0ba4a6b547c66830d8cd652f3c4e Signed-off-by: yacovm --- gossip/service/gossip_service.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gossip/service/gossip_service.go b/gossip/service/gossip_service.go index e3bf1e5bd19..97b63e67169 100644 --- a/gossip/service/gossip_service.go +++ b/gossip/service/gossip_service.go @@ -283,7 +283,9 @@ func (g *gossipServiceImpl) onStatusChangeFactory(chainID string, committer bloc return func(isLeader bool) { if isLeader { yield := func() { + g.lock.RLock() le := g.leaderElection[chainID] + g.lock.RUnlock() le.Yield() } logger.Info("Elected as a leader, starting delivery service for channel", chainID)