make it compile

pull/1072/head
Jeff Becker 4 years ago
parent 816070be62
commit 03c13f4261
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -49,8 +49,7 @@ namespace llarp
bool bool
RouterVersion::IsEmpty() const RouterVersion::IsEmpty() const
{ {
return std::equal(begin(), end(), emptyRouterVersion.begin(), return *this == emptyRouterVersion;
emptyRouterVersion.end());
} }
bool bool
@ -63,12 +62,17 @@ namespace llarp
[self = this, &idx](llarp_buffer_t* buffer, bool has) { [self = this, &idx](llarp_buffer_t* buffer, bool has) {
if(has) if(has)
{ {
uint64_t i;
if(idx == 0) if(idx == 0)
{ {
if(not bencode_read_integer(buffer, &self->m_ProtoVersion)) if(not bencode_read_integer(buffer, &self->m_ProtoVersion))
return false; return false;
} }
else if(not bencode_read_integer(buffer, &self->at(idx - 1))) else if(bencode_read_integer(buffer, &i))
{
self->m_Version[idx - 1] = i;
}
else
return false; return false;
++idx; ++idx;
} }

@ -46,6 +46,13 @@ namespace llarp
|| m_Version < other.m_Version; || m_Version < other.m_Version;
} }
bool
operator==(const RouterVersion& other) const
{
return m_ProtoVersion == other.m_ProtoVersion
&& m_Version == other.m_Version;
}
private: private:
Version_t m_Version = {0, 0, 0}; Version_t m_Version = {0, 0, 0};
uint64_t m_ProtoVersion = LLARP_PROTO_VERSION; uint64_t m_ProtoVersion = LLARP_PROTO_VERSION;

Loading…
Cancel
Save