remove our paths from outbound queues

This commit is contained in:
Thomas Winget 2019-11-07 13:23:06 -05:00
parent 17de3f2478
commit ef1a5652ef
No known key found for this signature in database
GPG Key ID: 58131A160789E630
3 changed files with 4 additions and 3 deletions

View File

@ -165,7 +165,7 @@ namespace llarp
void Builder::Tick(llarp_time_t)
{
const auto now = llarp::time_now_ms();
ExpirePaths(now);
ExpirePaths(now, m_router);
if(ShouldBuildMore(now))
BuildOne();
TickPaths(m_router);

View File

@ -73,7 +73,7 @@ namespace llarp
}
void
PathSet::ExpirePaths(llarp_time_t now)
PathSet::ExpirePaths(llarp_time_t now, AbstractRouter* router)
{
Lock_t l(&m_PathsMutex);
if(m_Paths.size() == 0)
@ -83,6 +83,7 @@ namespace llarp
{
if(itr->second->Expired(now))
{
router->outboundMessageHandler().QueueRemoveEmptyPath(itr->second->TXID());
itr = m_Paths.erase(itr);
}
else

View File

@ -148,7 +148,7 @@ namespace llarp
GetByUpstream(RouterID remote, PathID_t rxid) const;
void
ExpirePaths(llarp_time_t now);
ExpirePaths(llarp_time_t now, AbstractRouter* router);
/// get the number of paths in this status
size_t