From 850082c04c7dc70c972c5a9674f7c3f12ab47cfa Mon Sep 17 00:00:00 2001 From: Bartosz Oleaczek Date: Thu, 19 Dec 2024 12:17:58 +0100 Subject: [PATCH] Remove tech fallback from rpc_connect.go --- daemon/rpc_connect.go | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/daemon/rpc_connect.go b/daemon/rpc_connect.go index aa6346cc3..3bb940ca9 100644 --- a/daemon/rpc_connect.go +++ b/daemon/rpc_connect.go @@ -45,35 +45,6 @@ func (r *RPC) Connect(in *pb.ConnectRequest, srv pb.Daemon_ConnectServer) (retEr return err } -// nordWhisperConfigFallback checks if technology is configured to NordWhisper and falls back to NordLynx if NordWhisper -// was disabled in compile time or in remote config. It returns a new config with desired technology set. -func (r *RPC) nordWhisperConfigFallback(cfg config.Config) config.Config { - if cfg.Technology != config.Technology_NORDWHISPER { - return cfg - } - - nordWhisperEnabled, err := r.remoteConfigGetter.GetNordWhisperEnabled(r.version) - if err != nil { - log.Println(internal.ErrorPrefix, "failed to retrieve remote config for NordWhisper:", err) - return cfg - } - - if features.NordWhisperEnabled && nordWhisperEnabled { - return cfg - } - - log.Println(internal.DebugPrefix, - "user had configured NordWhisper technology, but it was disabled, falling back to NordLynx") - - cfg.Technology = config.Technology_NORDLYNX - r.cm.SaveWith(func(c config.Config) config.Config { - c.Technology = config.Technology_NORDLYNX - return c - }) - - return cfg -} - func (r *RPC) connect( ctx context.Context, in *pb.ConnectRequest, @@ -112,8 +83,6 @@ func (r *RPC) connect( } } - cfg = r.nordWhisperConfigFallback(cfg) - insights := r.dm.GetInsightsData().Insights // Measure the time it takes to obtain recommended servers list as the connection attempt event duration