Skip to content

Commit

Permalink
FAB-18301 Registrar.JoinChannel takes the wrong lock type (#2058)
Browse files Browse the repository at this point in the history
Replace RLock() with Lock() since Registrar.JoinChannel writes
to the internal data structure.

Signed-off-by: Yoav Tock <[email protected]>
Change-Id: Ic78a35ad6167e4ccbb3d1613ce1085bfdcb5aba1
  • Loading branch information
tock-ibm authored Oct 29, 2020
1 parent e4c54fa commit 067f09b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions orderer/common/multichannel/registrar.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,8 +693,8 @@ func (r *Registrar) ChannelInfo(channelID string) (types.ChannelInfo, error) {
// JoinChannel instructs the orderer to create a channel and join it with the provided config block.
// The URL field is empty, and is to be completed by the caller.
func (r *Registrar) JoinChannel(channelID string, configBlock *cb.Block, isAppChannel bool) (info types.ChannelInfo, err error) {
r.lock.RLock()
defer r.lock.RUnlock()
r.lock.Lock()
defer r.lock.Unlock()

if r.systemChannelID != "" {
return types.ChannelInfo{}, types.ErrSystemChannelExists
Expand Down

0 comments on commit 067f09b

Please sign in to comment.