token expiration threshold

This commit is contained in:
orignal 2022-06-19 08:52:47 -04:00
parent dd602a27b5
commit 5bb20cb039
3 changed files with 15 additions and 6 deletions

View file

@ -588,7 +588,11 @@ namespace transport
{
auto it = m_OutgoingTokens.find (ep);
if (it != m_OutgoingTokens.end ())
{
if (i2p::util::GetSecondsSinceEpoch () + SSU2_TOKEN_EXPIRATION_THRESHOLD > it->second.second)
return 0; // token expired
return it->second.first;
}
return 0;
}