From 8ffc2d1742ff1171a87b0410b21cbbd557ff8247 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 15 Jul 2021 16:30:52 +0000 Subject: [PATCH] Ignore unknown Events serialized with an odd type value. This should provide some additional future extensibility, allowing for new informational events which can be safely ignored to be ignored by older versions. --- lightning/src/util/events.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lightning/src/util/events.rs b/lightning/src/util/events.rs index 876dfe6a..33767010 100644 --- a/lightning/src/util/events.rs +++ b/lightning/src/util/events.rs @@ -312,6 +312,8 @@ impl MaybeReadable for Event { }; f() }, + // Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue. + x if x % 2 == 1 => Ok(None), _ => Err(msgs::DecodeError::InvalidValue) } } -- 2.30.2