From 56afba66067d3da0142cd8ee2743feb3abfab3b0 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Sat, 2 Aug 2014 08:37:10 +0200 Subject: [PATCH] Only change the announce server when upgrading config version --- config/config.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index 6e878307..66f3b746 100644 --- a/config/config.go +++ b/config/config.go @@ -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 }