Set data_loss_protect_required
authorDuncan Dean <git@dunxen.dev>
Tue, 2 May 2023 18:26:46 +0000 (20:26 +0200)
committerDuncan Dean <git@dunxen.dev>
Tue, 2 May 2023 18:26:46 +0000 (20:26 +0200)
lightning/src/ln/channelmanager.rs
lightning/src/ln/features.rs

index 498813de7a11900e2dbdcffa9adf8de9fd037d6c..9aa9ffad48597955f05396a262e3360d530fac00 100644 (file)
@@ -6684,7 +6684,7 @@ pub fn provided_init_features(_config: &UserConfig) -> InitFeatures {
        // should also add the corresponding (optional) bit to the [`ChannelMessageHandler`] impl for
        // [`ErroringMessageHandler`].
        let mut features = InitFeatures::empty();
-       features.set_data_loss_protect_optional();
+       features.set_data_loss_protect_required();
        features.set_upfront_shutdown_script_optional();
        features.set_variable_length_onion_required();
        features.set_static_remote_key_required();
index cf375603b37b5290aaf10250218f4b66cce0678a..8ccbf4166bbe71294a64309ed4832b9364845fa9 100644 (file)
@@ -856,7 +856,7 @@ mod tests {
                // Set a bunch of features we use, plus initial_routing_sync_required (which shouldn't get
                // converted as it's only relevant in an init context).
                init_features.set_initial_routing_sync_required();
-               init_features.set_data_loss_protect_optional();
+               init_features.set_data_loss_protect_required();
                init_features.set_variable_length_onion_required();
                init_features.set_static_remote_key_required();
                init_features.set_payment_secret_required();
@@ -876,7 +876,7 @@ mod tests {
                let node_features: NodeFeatures = init_features.to_context();
                {
                        // Check that the flags are as expected:
-                       // - option_data_loss_protect
+                       // - option_data_loss_protect (req)
                        // - var_onion_optin (req) | static_remote_key (req) | payment_secret(req)
                        // - basic_mpp | wumbo
                        // - opt_shutdown_anysegwit
@@ -884,7 +884,7 @@ mod tests {
                        // - option_channel_type | option_scid_alias
                        // - option_zeroconf
                        assert_eq!(node_features.flags.len(), 7);
-                       assert_eq!(node_features.flags[0], 0b00000010);
+                       assert_eq!(node_features.flags[0], 0b00000001);
                        assert_eq!(node_features.flags[1], 0b01010001);
                        assert_eq!(node_features.flags[2], 0b10001010);
                        assert_eq!(node_features.flags[3], 0b00001000);