Prevent Deadlock when Logging Protocol Engine Stopped #406

Merged
dan merged 2 commits from p2p-interim-new-storage into master 2021-11-27 00:15:02 +00:00
1 changed files with 2 additions and 1 deletions

View File

@ -916,7 +916,8 @@ func (cp *cwtchPeer) eventHandler() {
case event.ProtocolEngineStopped:
cp.mutex.Lock()
cp.listenStatus = false
log.Infof("Protocol engine for %v has stopped listening", cp.GetOnion())
onion, _ := cp.storage.LoadProfileKeyValue(TypeAttribute, attr.PublicScope.ConstructScopedZonedPath(attr.ProfileZone.ConstructZonedPath(constants.Onion)).ToString())
log.Infof("Protocol engine for %s has stopped listening", onion)
cp.mutex.Unlock()
case event.EncryptedGroupMessage: