mirror of https://github.com/oxen-io/lokinet
format
This commit is contained in:
parent
00d4942d85
commit
963250c0ef
|
@ -1090,7 +1090,7 @@ namespace llarp
|
|||
|
||||
bool
|
||||
Endpoint::HandleDataMessage(
|
||||
path::Path_ptr path, const PathID_t from, std::shared_ptr<ProtocolMessage> msg)
|
||||
path::Path_ptr, const PathID_t from, std::shared_ptr<ProtocolMessage> msg)
|
||||
{
|
||||
PutSenderFor(msg->tag, msg->sender, true);
|
||||
Introduction intro = msg->introReply;
|
||||
|
|
|
@ -350,25 +350,25 @@ namespace llarp
|
|||
}
|
||||
// check for stale intros
|
||||
// update the introset if we think we need to
|
||||
if (currentIntroSet.HasStaleIntros(now, path::intro_path_spread) or remoteIntro.ExpiresSoon(now, path::intro_path_spread))
|
||||
if (currentIntroSet.HasStaleIntros(now, path::intro_path_spread)
|
||||
or remoteIntro.ExpiresSoon(now, path::intro_path_spread))
|
||||
{
|
||||
UpdateIntroSet();
|
||||
ShiftIntroduction(false);
|
||||
}
|
||||
|
||||
if(ReadyToSend())
|
||||
if (ReadyToSend())
|
||||
{
|
||||
if(not remoteIntro.router.IsZero() and not GetPathByRouter(remoteIntro.router))
|
||||
if (not remoteIntro.router.IsZero() and not GetPathByRouter(remoteIntro.router))
|
||||
{
|
||||
std::vector<Introduction> otherPivots;
|
||||
ForEachPath([router=remoteIntro.router, &otherPivots](auto path)
|
||||
{
|
||||
if(path and path->IsReady() and path->Endpoint() != router)
|
||||
{
|
||||
otherPivots.emplace_back(path->intro);
|
||||
}
|
||||
});
|
||||
if(not otherPivots.empty())
|
||||
ForEachPath([router = remoteIntro.router, &otherPivots](auto path) {
|
||||
if (path and path->IsReady() and path->Endpoint() != router)
|
||||
{
|
||||
otherPivots.emplace_back(path->intro);
|
||||
}
|
||||
});
|
||||
if (not otherPivots.empty())
|
||||
{
|
||||
std::shuffle(otherPivots.begin(), otherPivots.end(), CSRNG{});
|
||||
remoteIntro = otherPivots[0];
|
||||
|
@ -456,7 +456,7 @@ namespace llarp
|
|||
}
|
||||
});
|
||||
return numValidPaths < numDesiredPaths or not havePathToNextIntro;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OutboundContext::MarkCurrentIntroBad(llarp_time_t now)
|
||||
|
@ -465,9 +465,8 @@ namespace llarp
|
|||
}
|
||||
|
||||
void
|
||||
OutboundContext::MarkIntroBad(const Introduction& , llarp_time_t )
|
||||
{
|
||||
}
|
||||
OutboundContext::MarkIntroBad(const Introduction&, llarp_time_t)
|
||||
{}
|
||||
|
||||
bool
|
||||
OutboundContext::IntroSent() const
|
||||
|
|
Loading…
Reference in New Issue