Ignore unknown Events serialized with an odd type value.
[rust-lightning] / lightning / src / util / events.rs
index 876dfe6abb551f359a6c67c60fe05c1d104b81ed..3376701042e2e5c66985b8f4f82d4a93b25c4136 100644 (file)
@@ -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)
                }
        }