From: Jeffrey Czyz Date: Fri, 30 Apr 2021 16:41:46 +0000 (-0700) Subject: Require feature var_onion_optin X-Git-Tag: v0.0.14~1^2~5 X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=rust-lightning;a=commitdiff_plain;h=1ec0232dc5081eebb5bd448a6a0963381f3c0fc6 Require feature var_onion_optin Feature payment_secret is required and depends on var_onion_optin, so the latter must also be required. --- diff --git a/lightning/src/ln/features.rs b/lightning/src/ln/features.rs index 02e403b4..507316d6 100644 --- a/lightning/src/ln/features.rs +++ b/lightning/src/ln/features.rs @@ -95,7 +95,7 @@ mod sealed { // Byte 0 , // Byte 1 - StaticRemoteKey | PaymentSecret, + VariableLengthOnion | StaticRemoteKey | PaymentSecret, // Byte 2 , // Byte 3 @@ -105,7 +105,7 @@ mod sealed { // Byte 0 DataLossProtect | InitialRoutingSync | UpfrontShutdownScript | GossipQueries, // Byte 1 - VariableLengthOnion, + , // Byte 2 BasicMPP, // Byte 3 @@ -117,7 +117,7 @@ mod sealed { // Byte 0 , // Byte 1 - StaticRemoteKey | PaymentSecret, + VariableLengthOnion | StaticRemoteKey | PaymentSecret, // Byte 2 , // Byte 3 @@ -127,7 +127,7 @@ mod sealed { // Byte 0 DataLossProtect | UpfrontShutdownScript | GossipQueries, // Byte 1 - VariableLengthOnion, + , // Byte 2 BasicMPP, // Byte 3 @@ -143,7 +143,7 @@ mod sealed { // Byte 0 , // Byte 1 - PaymentSecret, + VariableLengthOnion | PaymentSecret, // Byte 2 , ], @@ -151,7 +151,7 @@ mod sealed { // Byte 0 , // Byte 1 - VariableLengthOnion, + , // Byte 2 BasicMPP, ], @@ -730,8 +730,8 @@ mod tests { assert!(InitFeatures::known().supports_variable_length_onion()); assert!(NodeFeatures::known().supports_variable_length_onion()); - assert!(!InitFeatures::known().requires_variable_length_onion()); - assert!(!NodeFeatures::known().requires_variable_length_onion()); + assert!(InitFeatures::known().requires_variable_length_onion()); + assert!(NodeFeatures::known().requires_variable_length_onion()); assert!(InitFeatures::known().supports_static_remote_key()); assert!(NodeFeatures::known().supports_static_remote_key()); @@ -787,12 +787,12 @@ mod tests { { // Check that the flags are as expected: // - option_data_loss_protect - // - var_onion_optin | static_remote_key (req) | payment_secret(req) + // - var_onion_optin (req) | static_remote_key (req) | payment_secret(req) // - basic_mpp // - opt_shutdown_anysegwit assert_eq!(node_features.flags.len(), 4); assert_eq!(node_features.flags[0], 0b00000010); - assert_eq!(node_features.flags[1], 0b01010010); + assert_eq!(node_features.flags[1], 0b01010001); assert_eq!(node_features.flags[2], 0b00000010); assert_eq!(node_features.flags[3], 0b00001000); }