From 6a8c18f2fc3e2c3cea00c9925fa29cef12d00682 Mon Sep 17 00:00:00 2001 From: orignal Date: Thu, 2 Oct 2014 14:43:42 -0400 Subject: [PATCH] don't pick next peer same as previous --- NetDb.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NetDb.cpp b/NetDb.cpp index f50c98cd..2517d1a7 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -801,7 +801,8 @@ namespace data return GetRandomRouter ( [compatibleWith](const RouterInfo * router)->bool { - return !router->IsHidden () && router->IsCompatible (*compatibleWith); + return !router->IsHidden () && router != compatibleWith && + router->IsCompatible (*compatibleWith); }); } @@ -810,8 +811,8 @@ namespace data return GetRandomRouter ( [compatibleWith](const RouterInfo * router)->bool { - return !router->IsHidden () && router->IsCompatible (*compatibleWith) && - (router->GetCaps () & RouterInfo::eHighBandwidth); + return !router->IsHidden () && router != compatibleWith && + router->IsCompatible (*compatibleWith) && (router->GetCaps () & RouterInfo::eHighBandwidth); }); }