From 2f4e631c98b4b7e70372d269777c69a35b6c92a5 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 25 Feb 2026 19:05:43 -0500 Subject: [PATCH] use failed/success rate instead difference for evaluation --- libi2pd/Profiling.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libi2pd/Profiling.cpp b/libi2pd/Profiling.cpp index e77865b5..37504a3a 100644 --- a/libi2pd/Profiling.cpp +++ b/libi2pd/Profiling.cpp @@ -233,9 +233,10 @@ namespace data bool isBad = false; if (IsAlwaysDeclining () && m_NumTunnelsDeclined) isBad = m_ProfilesRng () % m_NumTunnelsDeclined; // only zero means not bad - if (!isBad && IsLowPartcipationRate ()) + else if (IsLowPartcipationRate ()) { - auto failed = m_NumTunnelsDeclined + (int)m_NumTunnelsNonReplied - m_NumTunnelsAgreed; + auto failed = m_NumTunnelsDeclined + (int)m_NumTunnelsNonReplied; + if (m_NumTunnelsAgreed > 0) failed /= m_NumTunnelsAgreed; if (failed > 0) isBad = m_ProfilesRng () % failed; // only zero means not bad }