Skip to content

Commit cb60945

Browse files
pfi79mergify[bot]
authored andcommitted
fix peer panic from fabric/gossip/util (#5136)
Signed-off-by: Fedor Partanskiy <fedor.partanskiy@atme.com> (cherry picked from commit fbc557f)
1 parent faaaaa8 commit cb60945

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

gossip/util/pubsub.go

Lines changed: 1 addition & 2 deletions
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)