Skip to content

Commit

Permalink
Remove tech fallback from rpc_connect.go
Browse files Browse the repository at this point in the history
  • Loading branch information
bartoszWojciechO committed Dec 19, 2024
1 parent 844571d commit 850082c
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions daemon/rpc_connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 850082c

Please sign in to comment.