forked from openprivacy/libricochet-go
BUGFIX: deadlock
This commit is contained in:
parent
6f9718596d
commit
417d25dc7c
|
@ -70,10 +70,12 @@ func (cm *ChannelManager) OpenChannelRequestFromPeer(channelID int32, chandler c
|
||||||
cm.lock.Lock()
|
cm.lock.Lock()
|
||||||
_, exists := cm.channels[channelID]
|
_, exists := cm.channels[channelID]
|
||||||
if exists {
|
if exists {
|
||||||
|
cm.lock.Unlock()
|
||||||
return nil, utils.ChannelIDIsAlreadyInUseError
|
return nil, utils.ChannelIDIsAlreadyInUseError
|
||||||
}
|
}
|
||||||
cm.lock.Unlock()
|
cm.lock.Unlock()
|
||||||
|
|
||||||
|
|
||||||
// Some channels only allow us to open one of them per connection
|
// Some channels only allow us to open one of them per connection
|
||||||
if chandler.Singleton() && cm.Channel(chandler.Type(), channels.Inbound) != nil {
|
if chandler.Singleton() && cm.Channel(chandler.Type(), channels.Inbound) != nil {
|
||||||
return nil, utils.AttemptToOpenMoreThanOneSingletonChannelError
|
return nil, utils.AttemptToOpenMoreThanOneSingletonChannelError
|
||||||
|
|
Loading…
Reference in New Issue