Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed Jan 26, 2023
1 parent 8231591 commit d540223
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions p2p/net/swarm/swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,15 @@ func (s *Swarm) addConn(tc transport.CapableConn, dir network.Direction) (*Conn,

// Take the notification lock before releasing the conns lock to block
// Disconnect notifications until after the Connect notifications done.
c.notifyLk.Lock()
s.conns.Unlock()
go func() {
c.notifyLk.Lock()
s.conns.Unlock()

s.notifyAll(func(f network.Notifiee) {
f.Connected(s, c)
})
c.notifyLk.Unlock()
s.notifyAll(func(f network.Notifiee) {
f.Connected(s, c)
})
c.notifyLk.Unlock()
}()

c.start()
return c, nil
Expand Down

0 comments on commit d540223

Please sign in to comment.