fix pathbuilder

pull/90/head
Jeff Becker 6 years ago
parent 7de2ce72ad
commit e11e83c397
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -179,17 +179,17 @@ namespace llarp
RouterContact& cur, size_t hop, PathRole roles)
{
(void)roles;
if(hop == 0 && router->NumberOfConnectedRouters())
return router->GetRandomConnectedRouter(cur);
if(hop == 0)
return router->NumberOfConnectedRouters() && router->GetRandomConnectedRouter(cur);
size_t tries = 5;
do
{
--tries;
if(llarp_nodedb_select_random_hop(db, prev, cur, hop))
break;
return true;
} while(router->routerProfiling.IsBad(cur.pubkey) && tries > 0);
return !router->routerProfiling.IsBad(cur.pubkey);
return false;
}
const byte_t*

@ -1203,7 +1203,7 @@ namespace llarp
if(!router->GetRandomConnectedRouter(hops[0]))
return false;
}
else if(!llarp_nodedb_select_random_hop(nodedb, hops[0], hops[0], 0))
else
return false;
}
else if(hop == numHops - 1)

Loading…
Cancel
Save