From 8763be12300b84c54a623e8e8235461e3d94c20a Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Fri, 26 Nov 2021 16:01:58 -0800 Subject: [PATCH] Prevent Deadlock when Logging Protocol Engine Stopped --- peer/cwtch_peer.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/peer/cwtch_peer.go b/peer/cwtch_peer.go index 2395af0..eeddd1a 100644 --- a/peer/cwtch_peer.go +++ b/peer/cwtch_peer.go @@ -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: