Only change the announce server when upgrading config version

This commit is contained in:
Jakob Borg 2014-08-02 08:37:10 +02:00
parent d65bbf2113
commit 56afba6606

View File

@ -338,12 +338,6 @@ func Load(rd io.Reader, myID protocol.NodeID) (Configuration, error) {
}
}
// The global discovery format and port number changed in v0.9. Having the
// default announce server but old port number is guaranteed to be legacy.
if cfg.Options.GlobalAnnServer == "announce.syncthing.net:22025" {
cfg.Options.GlobalAnnServer = "announce.syncthing.net:22026"
}
return cfg, err
}
@ -354,6 +348,13 @@ func convertV2V3(cfg *Configuration) {
for i := range cfg.Nodes {
cfg.Nodes[i].Compression = true
}
// The global discovery format and port number changed in v0.9. Having the
// default announce server but old port number is guaranteed to be legacy.
if cfg.Options.GlobalAnnServer == "announce.syncthing.net:22025" {
cfg.Options.GlobalAnnServer = "announce.syncthing.net:22026"
}
cfg.Version = 3
}