Verify channel type features for decoding.
[rust-lightning] / lightning / src / ln / chan_utils.rs
index d570347fef879af540cdfea9f5a68e9b22f3f57f..7fa2308d001cc59b97235bb466d97f7592e462d2 100644 (file)
@@ -952,6 +952,10 @@ impl Readable for ChannelTransactionParameters {
                        (11, channel_type_features, option),
                });
 
+               let mut additional_features = ChannelTypeFeatures::empty();
+               additional_features.set_anchors_nonzero_fee_htlc_tx_required();
+               chain::package::verify_channel_type_features(&channel_type_features, Some(&additional_features))?;
+
                Ok(Self {
                        holder_pubkeys: holder_pubkeys.0.unwrap(),
                        holder_selected_contest_delay: holder_selected_contest_delay.0.unwrap(),
@@ -1375,6 +1379,10 @@ impl Readable for CommitmentTransaction {
                        (15, channel_type_features, option),
                });
 
+               let mut additional_features = ChannelTypeFeatures::empty();
+               additional_features.set_anchors_nonzero_fee_htlc_tx_required();
+               chain::package::verify_channel_type_features(&channel_type_features, Some(&additional_features))?;
+
                Ok(Self {
                        commitment_number: commitment_number.0.unwrap(),
                        to_broadcaster_value_sat: to_broadcaster_value_sat.0.unwrap(),