1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

* rename i to foundIntro

* check for zero timestamp
* use > not >=
This commit is contained in:
Jeff Becker 2020-02-06 14:35:31 -05:00
parent 41210a8ae1
commit 8c698a1cd1
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05

View file

@ -84,28 +84,34 @@ namespace llarp
}
bool
OutboundContext::OnIntroSetUpdate(const Address&,
absl::optional< const IntroSet > i,
const RouterID& endpoint)
OutboundContext::OnIntroSetUpdate(
const Address&, absl::optional< const IntroSet > foundIntro,
const RouterID& endpoint)
{
if(markedBad)
return true;
updatingIntroSet = false;
if(i.has_value())
if(foundIntro.has_value())
{
if(currentIntroSet.T != 0 and currentIntroSet.T >= i->T)
if(foundIntro->T == 0)
{
LogWarn(Name(),
" got introset with zero timestamp: ", foundIntro.value());
return true;
}
if(currentIntroSet.T > foundIntro->T)
{
LogInfo("introset is old, dropping");
return true;
}
const llarp_time_t now = Now();
if(i->IsExpired(now))
if(foundIntro->IsExpired(now))
{
LogError("got expired introset from lookup from ", endpoint);
return true;
}
currentIntroSet = i.value();
currentIntroSet = foundIntro.value();
}
else
{