mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-10-31 09:20:21 +00:00
revert dht stuff
This commit is contained in:
parent
60fbeca9d4
commit
e1dd7ad97f
@ -108,8 +108,8 @@ namespace llarp
|
||||
|
||||
return true;
|
||||
}
|
||||
const size_t expecting = N;
|
||||
const size_t sz = nodes.size();
|
||||
size_t expecting = N;
|
||||
size_t sz = nodes.size();
|
||||
while(N)
|
||||
{
|
||||
auto itr = nodes.begin();
|
||||
@ -137,7 +137,7 @@ namespace llarp
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto curDist = item.first ^ target;
|
||||
auto curDist = item.first ^ target;
|
||||
if(curDist < mindist)
|
||||
{
|
||||
mindist = curDist;
|
||||
@ -151,16 +151,17 @@ namespace llarp
|
||||
GetManyNearExcluding(const Key_t& target, std::set< Key_t >& result,
|
||||
size_t N, const std::set< Key_t >& exclude) const
|
||||
{
|
||||
auto itr = nodes.lower_bound(target);
|
||||
const auto end = nodes.end();
|
||||
while(N > 0 && itr != end)
|
||||
std::set< Key_t > s(exclude.begin(), exclude.end());
|
||||
|
||||
Key_t peer;
|
||||
while(N--)
|
||||
{
|
||||
if(exclude.count(itr->first) == 0)
|
||||
if(!FindCloseExcluding(target, peer, s))
|
||||
{
|
||||
result.insert(itr->first);
|
||||
--N;
|
||||
return false;
|
||||
}
|
||||
++itr;
|
||||
s.insert(peer);
|
||||
result.insert(peer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user