From 46913daa38fe551b284a0c1f791ca917fb731340 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Fri, 7 Jul 2023 18:28:25 +0000 Subject: [PATCH] Fix backwards compat for `blocked_monitor_updates` In 1ce2beb77455a674888f3e3589723195eaa7b13c, `Channel::blocked_monitor_updates` was moved to an even TLV to ensure downgrades with vec entries are forbidden. However, the serialized type remained `vec_type`, which is always written. Instead, `optional_vec` must be used. --- lightning/src/ln/channel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 30280f0b..68581968 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -6781,7 +6781,7 @@ impl Writeable for Channel { (5, self.context.config, required), (6, serialized_holder_htlc_max_in_flight, option), (7, self.context.shutdown_scriptpubkey, option), - (8, self.context.blocked_monitor_updates, vec_type), + (8, self.context.blocked_monitor_updates, optional_vec), (9, self.context.target_closing_feerate_sats_per_kw, option), (11, self.context.monitor_pending_finalized_fulfills, vec_type), (13, self.context.channel_creation_height, required), @@ -7089,7 +7089,7 @@ impl<'a, 'b, 'c, ES: Deref, SP: Deref> ReadableArgs<(&'a ES, &'b SP, u32, &'c Ch (5, config, option), // Note that if none is provided we will *not* overwrite the existing one. (6, holder_max_htlc_value_in_flight_msat, option), (7, shutdown_scriptpubkey, option), - (8, blocked_monitor_updates, vec_type), + (8, blocked_monitor_updates, optional_vec), (9, target_closing_feerate_sats_per_kw, option), (11, monitor_pending_finalized_fulfills, vec_type), (13, channel_creation_height, option), -- 2.30.2