mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
Merge branch 'staging' of https://github.com/majestrate/loki-network
This commit is contained in:
commit
1a62382ce7
@ -434,11 +434,16 @@ llarp_nodedb::select_random_hop(const llarp::RouterContact &prev,
|
||||
do
|
||||
{
|
||||
auto itr = entries.begin();
|
||||
std::advance(itr, llarp::randint() % sz);
|
||||
if(itr == entries.end())
|
||||
{
|
||||
--tries;
|
||||
continue;
|
||||
}
|
||||
if(prev.pubkey == itr->second.pubkey)
|
||||
{
|
||||
if(tries--)
|
||||
--tries;
|
||||
continue;
|
||||
return false;
|
||||
}
|
||||
if(itr->second.addrs.size() && !itr->second.IsExpired(now))
|
||||
{
|
||||
|
@ -682,6 +682,7 @@ namespace llarp
|
||||
if(rotateKeys)
|
||||
{
|
||||
encryption = nextOnionKey;
|
||||
}
|
||||
// propagate RC by renegotiating sessions
|
||||
ForEachPeer([](llarp::ILinkSession *s) {
|
||||
if(s->RenegotiateSession())
|
||||
@ -689,7 +690,7 @@ namespace llarp
|
||||
else
|
||||
llarp::LogWarn("failed to renegotiate session");
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: do this async
|
||||
return SaveRC();
|
||||
} // namespace llarp
|
||||
@ -737,7 +738,7 @@ namespace llarp
|
||||
if(_rc.ExpiresSoon(now, llarp::randint() % 10000))
|
||||
{
|
||||
llarp::LogInfo("regenerating RC");
|
||||
if(!UpdateOurRC(IsServiceNode()))
|
||||
if(!UpdateOurRC(false))
|
||||
llarp::LogError("Failed to update our RC");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user