Browse Source

don't pick next peer same as previous

pull/102/head
orignal 10 years ago
parent
commit
6a8c18f2fc
  1. 7
      NetDb.cpp

7
NetDb.cpp

@ -801,7 +801,8 @@ namespace data @@ -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 @@ -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);
});
}

Loading…
Cancel
Save