mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 11:17:49 +02:00
Time experemental options
This commit is contained in:
parent
5a2b795440
commit
ea899fbbfd
17 changed files with 264 additions and 129 deletions
|
@ -28,7 +28,7 @@ namespace data
|
|||
bool isUpdated; // trasient
|
||||
/* return true if this lease expires within t millisecond + fudge factor */
|
||||
bool ExpiresWithin( const uint64_t t, const uint64_t fudge = 1000 ) const {
|
||||
auto expire = i2p::util::GetMillisecondsSinceEpoch ();
|
||||
auto expire = i2p::util::getTime<std::chrono::milliseconds> (i2p::util::TimeType::milliseconds);
|
||||
if(fudge) expire += rand() % fudge;
|
||||
if (endDate < expire) return true;
|
||||
return (endDate - expire) < t;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue