|
|
|
@ -695,9 +695,16 @@ namespace transport
@@ -695,9 +695,16 @@ namespace transport
|
|
|
|
|
SendTerminationAndTerminate (eNTCP2RouterInfoSignatureVerificationFail); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (i2p::util::GetMillisecondsSinceEpoch () > ri.GetTimestamp () + i2p::data::NETDB_MIN_EXPIRATION_TIMEOUT*1000LL) // 90 minutes
|
|
|
|
|
auto ts = i2p::util::GetMillisecondsSinceEpoch (); |
|
|
|
|
if (ts > ri.GetTimestamp () + i2p::data::NETDB_MIN_EXPIRATION_TIMEOUT*1000LL) // 90 minutes
|
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogError, "NTCP2: RouterInfo is too old in SessionConfirmed"); |
|
|
|
|
LogPrint (eLogError, "NTCP2: RouterInfo is too old in SessionConfirmed for ", (ts - ri.GetTimestamp ())/1000LL, " seconds"); |
|
|
|
|
SendTerminationAndTerminate (eNTCP2Message3Error); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (ts + i2p::data::NETDB_EXPIRATION_TIMEOUT_THRESHOLD*1000LL < ri.GetTimestamp ()) // 2 minutes
|
|
|
|
|
{ |
|
|
|
|
LogPrint (eLogError, "NTCP2: RouterInfo is from future for ", (ri.GetTimestamp () - ts)/1000LL, " seconds"); |
|
|
|
|
SendTerminationAndTerminate (eNTCP2Message3Error); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|