drop updated routers from future

This commit is contained in:
orignal 2024-01-06 11:31:01 -05:00
parent c5cab05a6b
commit 5cf1961fa4

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2023, The PurpleI2P Project * Copyright (c) 2013-2024, The PurpleI2P Project
* *
* This file is part of Purple i2pd project and licensed under BSD3 * This file is part of Purple i2pd project and licensed under BSD3
* *
@ -247,9 +247,10 @@ namespace data
m_Requests.RequestComplete (ident, r); m_Requests.RequestComplete (ident, r);
return r; return r;
} }
if (r->IsUnreachable ()) if (r->IsUnreachable () ||
i2p::util::GetMillisecondsSinceEpoch () + NETDB_EXPIRATION_TIMEOUT_THRESHOLD*1000LL < r->GetTimestamp ())
{ {
// delete router as invalid after update // delete router as invalid or from future after update
m_RouterInfos.erase (ident); m_RouterInfos.erase (ident);
if (wasFloodfill) if (wasFloodfill)
{ {