mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
Add 2 root peers. New seed list auto update.
This commit is contained in:
18
Config.go
18
Config.go
@@ -28,7 +28,9 @@ var config struct {
|
||||
PrivateKey string `yaml:"PrivateKey"` // The Private Key, hex encoded so it can be copied manually
|
||||
|
||||
// Initial peer seed list
|
||||
SeedList []peerSeed `yaml:"SeedList"`
|
||||
SeedList []peerSeed `yaml:"SeedList"`
|
||||
AutoUpdateSeedList bool `yaml:"AutoUpdateSeedList"`
|
||||
SeedListVersion int `yaml:"SeedListVersion"`
|
||||
}
|
||||
|
||||
// peerSeed is a singl peer entry from the config's seed list
|
||||
@@ -120,3 +122,17 @@ func InitLog() (err error) {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func configUpdateSeedList() {
|
||||
// parse the embedded config
|
||||
configD := config
|
||||
if err := yaml.Unmarshal(defaultConfig, &configD); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if config.SeedListVersion < configD.SeedListVersion {
|
||||
config.SeedList = configD.SeedList
|
||||
config.SeedListVersion = configD.SeedListVersion
|
||||
saveConfig()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user