mirror of https://github.com/oxen-io/lokinet
add 'is_stale' and 'is_outdated' functions to RouterContact
This commit is contained in:
parent
f87c37fbb6
commit
51eab687d3
|
@ -248,6 +248,18 @@ namespace llarp
|
|||
return delta > 0s ? delta : 0s;
|
||||
}
|
||||
|
||||
bool
|
||||
RouterContact::is_stale(llarp_time_t now) const
|
||||
{
|
||||
return age(now) >= _timestamp.time_since_epoch() + STALE_AGE;
|
||||
}
|
||||
|
||||
bool
|
||||
RouterContact::is_outdated(llarp_time_t now) const
|
||||
{
|
||||
return age(now) >= _timestamp.time_since_epoch() + OUTDATED_AGE;
|
||||
}
|
||||
|
||||
bool
|
||||
RouterContact::expires_within_delta(llarp_time_t now, llarp_time_t dlt) const
|
||||
{
|
||||
|
|
|
@ -194,6 +194,12 @@ namespace llarp
|
|||
llarp_time_t
|
||||
age(llarp_time_t now) const;
|
||||
|
||||
bool
|
||||
is_stale(llarp_time_t now) const;
|
||||
|
||||
bool
|
||||
is_outdated(llarp_time_t now) const;
|
||||
|
||||
bool
|
||||
other_is_newer(const RouterContact& other) const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue