Merge pull request #1085 from majestrate/check-for-initial-current-introset-2020-02-06

check for current introset being zero (initial state)
pull/1095/head
Jeff 4 years ago committed by GitHub
commit 671c765161
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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 >= 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…
Cancel
Save