We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a598117 commit 59bde8dCopy full SHA for 59bde8d
src/peer/address_repository/inmem_address_repository.cpp
@@ -66,11 +66,11 @@ namespace libp2p::peer {
66
67
Clock::time_point InmemAddressRepository::calculateExpirationTime(
68
const Milliseconds &ttl) const {
69
- if (ttl >= std::chrono::milliseconds::max() / 2) {
70
- // Handle "permanent" or extremely long TTL values safely
+ auto now = Clock::now();
+ if (now >= Clock::time_point::max() - ttl) {
71
return Clock::time_point::max();
72
}
73
- return Clock::now() + ttl;
+ return now + ttl;
74
75
76
outcome::result<bool> InmemAddressRepository::addAddresses(
0 commit comments