|
|
@ -87,10 +87,6 @@ func initNetwork(jnw JNetwork) (*dnsseeder, error) { |
|
|
|
return nil, errors.New(fmt.Sprintf("No DNS Hostname supplied")) |
|
|
|
return nil, errors.New(fmt.Sprintf("No DNS Hostname supplied")) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if _, ok := config.seeders[jnw.Name]; ok { |
|
|
|
|
|
|
|
return nil, errors.New(fmt.Sprintf("Name already exists from previous file - %s", jnw.Name)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// init the seeder
|
|
|
|
// init the seeder
|
|
|
|
seeder := &dnsseeder{} |
|
|
|
seeder := &dnsseeder{} |
|
|
|
seeder.theList = make(map[string]*node) |
|
|
|
seeder.theList = make(map[string]*node) |
|
|
@ -130,14 +126,9 @@ func initNetwork(jnw JNetwork) (*dnsseeder, error) { |
|
|
|
if seeder.ttl < 60 { |
|
|
|
if seeder.ttl < 60 { |
|
|
|
seeder.ttl = 60 |
|
|
|
seeder.ttl = 60 |
|
|
|
} |
|
|
|
} |
|
|
|
// check for duplicates
|
|
|
|
|
|
|
|
for _, v := range config.seeders { |
|
|
|
if dup, err := isDuplicateSeeder(seeder); dup == true { |
|
|
|
if v.id == seeder.id { |
|
|
|
return nil, err |
|
|
|
return nil, errors.New(fmt.Sprintf("Duplicate Magic id. Already loaded for %s so can not be used for %s", v.id, v.name, seeder.name)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if v.dnsHost == seeder.dnsHost { |
|
|
|
|
|
|
|
return nil, errors.New(fmt.Sprintf("Duplicate DNS names. Already loaded %s for %s so can not be used for %s", v.dnsHost, v.name, seeder.name)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return seeder, nil |
|
|
|
return seeder, nil |
|
|
|