Skip to content

Commit fbc557f

Browse files
authored
fix peer panic from fabric/gossip/util (hyperledger#5136)
Signed-off-by: Fedor Partanskiy <[email protected]>
1 parent 9b20f5c commit fbc557f

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)