mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
p2p/server : not deal with run peer goroutines in mainloop wg
This commit is contained in:
parent
c786a726ff
commit
a2af3d5a73
1 changed files with 0 additions and 2 deletions
|
|
@ -1021,14 +1021,12 @@ func (srv *Server) launchPeer(c *conn) *Peer {
|
|||
// to the peer.
|
||||
p.events = &srv.peerFeed
|
||||
}
|
||||
srv.loopWG.Add(1)
|
||||
go srv.runPeer(p)
|
||||
return p
|
||||
}
|
||||
|
||||
// runPeer runs in its own goroutine for each peer.
|
||||
func (srv *Server) runPeer(p *Peer) {
|
||||
defer srv.loopWG.Done()
|
||||
if srv.newPeerHook != nil {
|
||||
srv.newPeerHook(p)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue