1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

diversify endpoints

This commit is contained in:
Jeff Becker 2020-01-06 10:28:37 -05:00
parent 9f153f12e0
commit 8a5365d9a6
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05

View file

@ -647,6 +647,13 @@ namespace llarp
// exclude exit node as first hop in any paths
exclude.insert(exits.begin(), exits.end());
}
if(hop == numHops - 1)
{
// diversify endpoints
ForEachPath([&exclude](const path::Path_ptr& path) {
exclude.insert(path->Endpoint());
});
}
return path::Builder::SelectHop(db, exclude, cur, hop, roles);
}