From 23fc2ad0423fa28d171a01637f2a5f62af0d330d Mon Sep 17 00:00:00 2001 From: Stephen Shelton Date: Tue, 3 Dec 2019 16:55:16 -0700 Subject: [PATCH] Init key manager before InitOutboundLinks are configured --- llarp/config/key_manager.cpp | 10 ---------- llarp/config/key_manager.hpp | 1 - llarp/router/router.cpp | 6 +++--- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/llarp/config/key_manager.cpp b/llarp/config/key_manager.cpp index 803a7eedb..e9c603437 100644 --- a/llarp/config/key_manager.cpp +++ b/llarp/config/key_manager.cpp @@ -131,16 +131,6 @@ namespace llarp return m_transportKey; } - bool - KeyManager::getRouterContact(llarp::RouterContact& rc) const - { - if (! m_initialized) - return false; - - rc = m_rc; - return true; - } - bool KeyManager::backupKeyFilesByMoving() const { diff --git a/llarp/config/key_manager.hpp b/llarp/config/key_manager.hpp index d333358ed..1d35590b7 100644 --- a/llarp/config/key_manager.hpp +++ b/llarp/config/key_manager.hpp @@ -75,7 +75,6 @@ namespace llarp std::string m_lokidRPCUser; std::string m_lokidRPCPassword; - llarp::RouterContact m_rc; llarp::SecretKey m_idKey; llarp::SecretKey m_encKey; llarp::SecretKey m_transportKey; diff --git a/llarp/router/router.cpp b/llarp/router/router.cpp index b104f9de3..90958777f 100644 --- a/llarp/router/router.cpp +++ b/llarp/router/router.cpp @@ -231,13 +231,13 @@ namespace llarp } _nodedb = nodedb; - if(!FromConfig(conf)) + if (not m_keyManager->initialize(*conf, true)) return false; - if(!InitOutboundLinks()) + if(!FromConfig(conf)) return false; - if (not m_keyManager->initialize(*conf, true)) + if(!InitOutboundLinks()) return false; return EnsureIdentity();