better handling for introset propagation

pull/16/head
Jeff Becker 6 years ago
parent a91f54cc8a
commit 4309ea3b97
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -53,12 +53,16 @@ namespace llarp
if(!I.Verify(&dht.router->crypto))
{
llarp::LogWarn("invalid introset: ", I);
return false;
// don't propogate or store
replies.emplace_back(new GotIntroMessage({}, txID));
return true;
}
if(I.W && !I.W->IsValid(dht.router->crypto.shorthash))
{
llarp::LogWarn("proof of work not good enough for IntroSet");
return false;
// don't propogate or store
replies.emplace_back(new GotIntroMessage({}, txID));
return true;
}
llarp::dht::Key_t addr;
if(!I.A.CalculateAddress(addr))
@ -68,9 +72,10 @@ namespace llarp
return false;
}
auto now = llarp_time_now_ms();
now += llarp::service::MAX_INTROSET_TIME_DELTA;
if(I.IsExpired(now))
{
// don't propogate or store expired introsets
// don't propogate or store
replies.emplace_back(new GotIntroMessage({}, txID));
return true;
}

@ -273,8 +273,6 @@ namespace llarp
{
if(!introset.Verify(crypto))
{
llarp::LogInfo("invalid introset ", introset, " on endpoint ",
Name());
if(m_Identity.pub == introset.A && m_CurrentPublishTX == msg->T)
{
IntroSetPublishFail();

Loading…
Cancel
Save