Skip to content

Commit e45801f

Browse files
pfi79denyeart
authored andcommitted
fix peer panic from fabric/gossip/util (#5136)
Signed-off-by: Fedor Partanskiy <[email protected]> (cherry picked from commit fbc557f)
1 parent faaaaa8 commit e45801f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gossip/util/pubsub.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,9 @@ func (ps *PubSub) Subscribe(topic string, ttl time.Duration) Subscription {
9797
s = NewSet()
9898
ps.subscriptions[topic] = s
9999
}
100-
ps.Unlock()
101-
102100
// Add the subscription
103101
s.Add(sub)
102+
ps.Unlock()
104103

105104
// When the timeout expires, remove the subscription
106105
time.AfterFunc(ttl, func() {

0 commit comments

Comments
 (0)