From 6cfbb1f3206ceafba1c411d2b5cff385dd38cad1 Mon Sep 17 00:00:00 2001 From: Viktor Liu <17948409+lixmal@users.noreply.github.com> Date: Thu, 5 Dec 2024 12:41:12 +0100 Subject: [PATCH] [client] Init route selector early (#2989) --- client/internal/routemanager/manager.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/internal/routemanager/manager.go b/client/internal/routemanager/manager.go index f1c4ae5ef75..8bf3a91b0d2 100644 --- a/client/internal/routemanager/manager.go +++ b/client/internal/routemanager/manager.go @@ -124,6 +124,8 @@ func NewManager( // Init sets up the routing func (m *DefaultManager) Init() (nbnet.AddHookFunc, nbnet.RemoveHookFunc, error) { + m.routeSelector = m.initSelector() + if nbnet.CustomRoutingDisabled() { return nil, nil, nil } @@ -144,8 +146,6 @@ func (m *DefaultManager) Init() (nbnet.AddHookFunc, nbnet.RemoveHookFunc, error) return nil, nil, fmt.Errorf("setup routing: %w", err) } - m.routeSelector = m.initSelector() - log.Info("Routing setup complete") return beforePeerHook, afterPeerHook, nil }