server: don't re-use existing wait group for loops within initialPeerBootstrap

This commit is contained in:
Olaoluwa Osuntokun 2019-06-27 18:49:48 -07:00
parent 9c957193cf
commit abe73ca6c1
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

View File

@ -1719,7 +1719,6 @@ func (s *server) peerBootstrapper(numTargetPeers uint32,
func (s *server) initialPeerBootstrap(ignore map[autopilot.NodeID]struct{},
numTargetPeers uint32, bootstrappers []discovery.NetworkPeerBootstrapper) {
var wg sync.WaitGroup
for {
// Check if the server has been requested to shut down in order
@ -1752,6 +1751,7 @@ func (s *server) initialPeerBootstrap(ignore map[autopilot.NodeID]struct{},
// Then, we'll attempt to establish a connection to the
// different peer addresses retrieved by our bootstrappers.
var wg sync.WaitGroup
for _, bootstrapAddr := range bootstrapAddrs {
wg.Add(1)
go func(addr *lnwire.NetAddress) {