Skip to content

Commit

Permalink
Backwards compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Aug 6, 2024
1 parent 009a4ba commit ea56d10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nano/node/messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,14 +1036,13 @@ bool nano::telemetry_ack::deserialize (nano::stream & stream_a)
{
if (!is_empty_payload ())
{
data.deserialize (stream_a, nano::narrow_cast<uint16_t> (header.extensions.to_ulong ()));
data.deserialize (stream_a, size ());
}
}
catch (std::runtime_error const &)
{
error = true;
// Ignore deserialization errors for backwards compatibility
}

return error;
}

Expand Down Expand Up @@ -1084,6 +1083,7 @@ void nano::telemetry_ack::operator() (nano::object_stream & obs) const
void nano::telemetry_data::deserialize (nano::stream & stream, uint16_t payload_length)
{
read (stream, signature);

read (stream, node_id);
read (stream, block_count);
boost::endian::big_to_native_inplace (block_count);
Expand Down Expand Up @@ -1118,6 +1118,7 @@ void nano::telemetry_data::deserialize (nano::stream & stream, uint16_t payload_
read (stream, active_difficulty);
boost::endian::big_to_native_inplace (active_difficulty);

// Added in V27, will throw if not present
uint8_t database_backend_l;
read (stream, database_backend_l);
database_backend = static_cast<nano::telemetry_backend> (database_backend_l);
Expand Down

0 comments on commit ea56d10

Please sign in to comment.