each goroutine needs its own random source.

caught by the race detector.
This commit is contained in:
David Hill 2014-07-10 14:52:02 -04:00
parent bd7a100ebb
commit ba937630d0

View file

@ -499,9 +499,10 @@ func (s *server) seedFromDNS() {
return return
} }
randSource := mrand.New(mrand.NewSource(time.Now().UnixNano()))
for _, seeder := range activeNetParams.dnsSeeds { for _, seeder := range activeNetParams.dnsSeeds {
go func(seeder string) { go func(seeder string) {
randSource := mrand.New(mrand.NewSource(time.Now().UnixNano()))
seedpeers, err := dnsDiscover(seeder) seedpeers, err := dnsDiscover(seeder)
if err != nil { if err != nil {
discLog.Infof("DNS discovery failed on seed %s: %v", seeder, err) discLog.Infof("DNS discovery failed on seed %s: %v", seeder, err)