From 9e531c026c9b19c8e451cdc9fae043575229f11d Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Tue, 26 Mar 2019 16:41:41 -0400 Subject: [PATCH] fix warning on hop selection --- llarp/service/endpoint.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/llarp/service/endpoint.cpp b/llarp/service/endpoint.cpp index d603a2c97..efcd1217c 100644 --- a/llarp/service/endpoint.cpp +++ b/llarp/service/endpoint.cpp @@ -1175,12 +1175,10 @@ namespace llarp , currentIntroSet(introset) { - auto& profiling = parent->m_Router->routerProfiling(); updatingIntroSet = false; for(const auto intro : introset.I) { - if(intro.expiresAt > m_NextIntro.expiresAt - && !profiling.IsBad(intro.router)) + if(intro.expiresAt > m_NextIntro.expiresAt) { m_NextIntro = intro; remoteIntro = intro; @@ -1848,13 +1846,21 @@ namespace llarp llarp::path::PathRole roles) { if(m_NextIntro.router.IsZero()) + { + llarp::LogError("intro is not set, cannot select hops"); return false; + } if(hop == numHops - 1) { if(db->Get(m_NextIntro.router, cur)) { return true; } + else if(router->routerProfiling().IsBad(m_NextIntro.router)) + { + llarp::LogError("bad intro chosen, not selecting hop"); + return false; + } else { // we don't have it?