Skip to content

Commit 201a814

Browse files
committed
[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 <[email protected]>
1 parent f3d0f5c commit 201a814

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

gossip/service/gossip_service.go

+2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ func (g *gossipServiceImpl) onStatusChangeFactory(chainID string, committer bloc
283283
return func(isLeader bool) {
284284
if isLeader {
285285
yield := func() {
286+
g.lock.RLock()
286287
le := g.leaderElection[chainID]
288+
g.lock.RUnlock()
287289
le.Yield()
288290
}
289291
logger.Info("Elected as a leader, starting delivery service for channel", chainID)

0 commit comments

Comments
 (0)