update readme and make dht bootstrap work with low peer count

pull/15/head
Jeff Becker 6 years ago
parent b23dab09fb
commit 96526058b2
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -18,6 +18,12 @@ namespace llarp
Bucket(const Key_t& us) : nodes(XorMetric(us)){};
size_t
Size() const
{
return nodes.size();
}
bool
GetRandomNodeExcluding(Key_t& result,
const std::set< Key_t >& exclude) const

@ -634,11 +634,21 @@ namespace llarp
std::vector< RouterID > closer;
Key_t t(target.data());
std::set< Key_t > found;
if(!nodes->GetManyNearExcluding(t, found, 4,
size_t nodeCount = nodes->Size();
if(nodeCount == 0)
{
llarp::LogError(
"cannot handle exploritory router lookup, no dht peers");
return false;
}
size_t want = std::min(4UL, nodeCount);
if(!nodes->GetManyNearExcluding(t, found, want,
std::set< Key_t >{ourKey, requester}))
{
llarp::LogError(
"not enough dht nodes to handle exploritory router lookup");
"not enough dht nodes to handle exploritory router lookup, "
"need a minimum of ",
want, " dht peers");
return false;
}
for(const auto &f : found)

@ -6,4 +6,11 @@ You can learn more about the high level design of LLARP [here](doc/high-level.tx
And you can read the LLARP protocol specification [here](doc/proto_v0.txt)
To build lokinet see the [lokinet-builder](https://github.com/loki-project/lokinet-builder) repository.
To build lokinet see the [lokinet-builder](https://github.com/loki-project/lokinet-builder) repository.
Download the latest release:
https://github.com/loki-project/loki-network/releases
If your platform doesn't have a release binary try building from source and report any bugs you find along the way.

Loading…
Cancel
Save