From 7f172964f6f7685a3fc7034e06b2eaf7678250c0 Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 4 May 2015 13:01:27 -0400 Subject: [PATCH] check profile only once --- NetDb.cpp | 3 +-- TunnelPool.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/NetDb.cpp b/NetDb.cpp index 48405088..6408b7f8 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -905,8 +905,7 @@ namespace data { return !router->IsHidden () && router != compatibleWith && router->IsCompatible (*compatibleWith) && - (router->GetCaps () & RouterInfo::eHighBandwidth) && - !router->GetProfile ()->IsBad (); + (router->GetCaps () & RouterInfo::eHighBandwidth); }); } diff --git a/TunnelPool.cpp b/TunnelPool.cpp index 505b82f3..95906472 100644 --- a/TunnelPool.cpp +++ b/TunnelPool.cpp @@ -281,8 +281,8 @@ namespace tunnel bool isExploratory = (m_LocalDestination == &i2p::context); // TODO: implement it better auto hop = isExploratory ? i2p::data::netdb.GetRandomRouter (prevHop): i2p::data::netdb.GetHighBandwidthRandomRouter (prevHop); - - if (!hop) + + if (!hop || hop->GetProfile ()->IsBad ()) hop = i2p::data::netdb.GetRandomRouter (); return hop; }