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
RouterVersion::IsEmpty() const
{
return std::equal(begin(), end(), emptyRouterVersion.begin(),
emptyRouterVersion.end());
return *this == emptyRouterVersion;
}
bool
@ -63,12 +62,17 @@ namespace llarp
[self = this, &idx](llarp_buffer_t* buffer, bool has) {
if(has)
{
uint64_t i;
if(idx == 0)
{
if(not bencode_read_integer(buffer, &self->m_ProtoVersion))
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;
++idx;
}

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

Loading…
Cancel
Save