limiting on path building

pull/120/head
Jeff Becker 6 years ago
parent 3d05ac1113
commit 56fea3c4db
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -25,9 +25,9 @@ namespace llarp
{
const size_t expect = (1 + (m_NumPaths / 2));
if(NumPathsExistingAt(now + (10 * 1000)) < expect)
return true;
return path::Builder::ShouldBuildMore(now);
if(AvailablePaths(llarp::path::ePathRoleExit) < expect)
return true;
return path::Builder::ShouldBuildMore(now);
return false;
}
@ -45,6 +45,7 @@ namespace llarp
void
BaseSession::HandlePathBuilt(llarp::path::Path* p)
{
path::Builder::HandlePathBuilt(p);
p->SetDropHandler(std::bind(&BaseSession::HandleTrafficDrop, this,
std::placeholders::_1, std::placeholders::_2,
std::placeholders::_3));
@ -155,4 +156,4 @@ namespace llarp
}
} // namespace exit
} // namespace llarp
} // namespace llarp

@ -264,11 +264,7 @@ namespace llarp
{
if(builder->ShouldBuildMore(now))
{
builder->BuildOne(ePathRoleAny);
}
if(builder->ShouldBuildMoreForRoles(now, ePathRoleExit))
{
builder->BuildOne(ePathRoleExit);
builder->BuildOne();
}
}
}

Loading…
Cancel
Save