diff --git a/connection/channelmanager.go b/connection/channelmanager.go index 6841c4f..3921e2c 100644 --- a/connection/channelmanager.go +++ b/connection/channelmanager.go @@ -70,10 +70,12 @@ func (cm *ChannelManager) OpenChannelRequestFromPeer(channelID int32, chandler c cm.lock.Lock() _, exists := cm.channels[channelID] if exists { + cm.lock.Unlock() return nil, utils.ChannelIDIsAlreadyInUseError } cm.lock.Unlock() + // Some channels only allow us to open one of them per connection if chandler.Singleton() && cm.Channel(chandler.Type(), channels.Inbound) != nil { return nil, utils.AttemptToOpenMoreThanOneSingletonChannelError