move function into source file out of header and add operator overloading for == and != on introset

pull/26/head
Jeff Becker 6 years ago
parent 71c9965471
commit 252b2ee3fb
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -85,6 +85,20 @@ namespace llarp
return A < other.A;
}
bool
operator==(const IntroSet& other) const
{
return A == other.A && I == other.I && K == other.K && T == other.T
&& version == other.version && topic == other.topic && W == other.W
&& Z == other.Z;
}
bool
operator!=(const IntroSet& other) const
{
return !(*this == other);
}
bool
OtherIsNewer(const IntroSet& other) const
{
@ -119,13 +133,7 @@ namespace llarp
}
llarp_time_t
GetNewestIntroExpiration() const
{
llarp_time_t t = 0;
for(const auto& intro : I)
t = std::max(intro.expiresAt, t);
return t;
}
GetNewestIntroExpiration() const;
bool
HasExpiredIntros(llarp_time_t now) const;

@ -340,6 +340,15 @@ namespace llarp
return true;
}
llarp_time_t
IntroSet::GetNewestIntroExpiration() const
{
llarp_time_t t = 0;
for(const auto& intro : I)
t = std::max(intro.expiresAt, t);
return t;
}
bool
Config::Load(const std::string& fname)
{

@ -644,7 +644,6 @@ namespace llarp
void
Endpoint::PutNewOutboundContext(const llarp::service::IntroSet& introset)
{
Address addr;
introset.A.CalculateAddress(addr.data());

Loading…
Cancel
Save