From ea56d1006c3d49d391432a7b37246d48e6e0752a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:20:07 +0200 Subject: [PATCH] Backwards compatibility --- nano/node/messages.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nano/node/messages.cpp b/nano/node/messages.cpp index 042c509fae..cdd7e587e6 100644 --- a/nano/node/messages.cpp +++ b/nano/node/messages.cpp @@ -1036,14 +1036,13 @@ bool nano::telemetry_ack::deserialize (nano::stream & stream_a) { if (!is_empty_payload ()) { - data.deserialize (stream_a, nano::narrow_cast (header.extensions.to_ulong ())); + data.deserialize (stream_a, size ()); } } catch (std::runtime_error const &) { - error = true; + // Ignore deserialization errors for backwards compatibility } - return error; } @@ -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); @@ -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 (database_backend_l);