From 84f0b5d41adc4ee9b27548e729ee68c71fd20387 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Wed, 27 Apr 2016 14:38:29 -0700 Subject: [PATCH 1/2] Add missing RLock in State.Channel --- state.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/state.go b/state.go index 7993151..b170ce0 100644 --- a/state.go +++ b/state.go @@ -324,6 +324,9 @@ func (s *State) Channel(channelID string) (*Channel, error) { if s == nil { return nil, ErrNilState } + + s.Rlock() + defer s.RUnlock() if c, ok := s.channelMap[channelID]; ok { return c, nil From 7efe4ccfeeb2312d2f4a83f077b2e3d0e7336c19 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Wed, 27 Apr 2016 14:43:43 -0700 Subject: [PATCH 2/2] :ok_hand: --- state.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/state.go b/state.go index b170ce0..e3c8908 100644 --- a/state.go +++ b/state.go @@ -325,7 +325,7 @@ func (s *State) Channel(channelID string) (*Channel, error) { return nil, ErrNilState } - s.Rlock() + s.RLock() defer s.RUnlock() if c, ok := s.channelMap[channelID]; ok {