mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 04:04:16 +00:00
correct monotonic expiration time calculation
This commit is contained in:
parent
713513aacc
commit
32fe2e7974
@ -59,7 +59,7 @@ namespace data
|
|||||||
ts *= 1000; // in milliseconds
|
ts *= 1000; // in milliseconds
|
||||||
if (ts > m_ExpirationTime) m_ExpirationTime = ts;
|
if (ts > m_ExpirationTime) m_ExpirationTime = ts;
|
||||||
// make sure leaseset is newer than previous, but adding some time to expiration date
|
// make sure leaseset is newer than previous, but adding some time to expiration date
|
||||||
ts += (currentTime - it->GetCreationTime ())*2/i2p::tunnel::TUNNEL_EXPIRATION_TIMEOUT; // up to 2000 millisecond
|
ts += (currentTime - it->GetCreationTime ()*1000LL)*2/i2p::tunnel::TUNNEL_EXPIRATION_TIMEOUT; // up to 2 secs
|
||||||
htobe64buf (m_Buffer + m_BufferLen, ts);
|
htobe64buf (m_Buffer + m_BufferLen, ts);
|
||||||
m_BufferLen += 8; // end date
|
m_BufferLen += 8; // end date
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user