mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-15 12:13:24 +00:00
better handling for introset propagation
This commit is contained in:
parent
a91f54cc8a
commit
4309ea3b97
@ -53,12 +53,16 @@ namespace llarp
|
|||||||
if(!I.Verify(&dht.router->crypto))
|
if(!I.Verify(&dht.router->crypto))
|
||||||
{
|
{
|
||||||
llarp::LogWarn("invalid introset: ", I);
|
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))
|
if(I.W && !I.W->IsValid(dht.router->crypto.shorthash))
|
||||||
{
|
{
|
||||||
llarp::LogWarn("proof of work not good enough for IntroSet");
|
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;
|
llarp::dht::Key_t addr;
|
||||||
if(!I.A.CalculateAddress(addr))
|
if(!I.A.CalculateAddress(addr))
|
||||||
@ -68,9 +72,10 @@ namespace llarp
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
auto now = llarp_time_now_ms();
|
auto now = llarp_time_now_ms();
|
||||||
|
now += llarp::service::MAX_INTROSET_TIME_DELTA;
|
||||||
if(I.IsExpired(now))
|
if(I.IsExpired(now))
|
||||||
{
|
{
|
||||||
// don't propogate or store expired introsets
|
// don't propogate or store
|
||||||
replies.emplace_back(new GotIntroMessage({}, txID));
|
replies.emplace_back(new GotIntroMessage({}, txID));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -273,8 +273,6 @@ namespace llarp
|
|||||||
{
|
{
|
||||||
if(!introset.Verify(crypto))
|
if(!introset.Verify(crypto))
|
||||||
{
|
{
|
||||||
llarp::LogInfo("invalid introset ", introset, " on endpoint ",
|
|
||||||
Name());
|
|
||||||
if(m_Identity.pub == introset.A && m_CurrentPublishTX == msg->T)
|
if(m_Identity.pub == introset.A && m_CurrentPublishTX == msg->T)
|
||||||
{
|
{
|
||||||
IntroSetPublishFail();
|
IntroSetPublishFail();
|
||||||
|
Loading…
Reference in New Issue
Block a user