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:
parent
41210a8ae1
commit
8c698a1cd1
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue