remove our paths from outbound queues

pull/873/head
Thomas Winget 5 years ago
parent 17de3f2478
commit ef1a5652ef
No known key found for this signature in database
GPG Key ID: 58131A160789E630

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

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

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

Loading…
Cancel
Save