+// This file is Copyright its original authors, visible in version control
+// history.
+//
+// This file is licensed under the Apache License, Version 2.0 <LICENSE-APACHE
+// or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
+// You may not use this file except in accordance with one or both of these
+// licenses.
+
//! Feature flag definitions for the Lightning protocol according to [BOLT #9].
//!
//! Lightning nodes advertise a supported set of operation through feature flags. Features are
// Byte 0
,
// Byte 1
- ,
+ StaticRemoteKey,
// Byte 2
,
],
// Byte 0
,
// Byte 1
- ,
+ StaticRemoteKey,
// Byte 2
,
],
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());
- assert!(!InitFeatures::known().requires_static_remote_key());
- assert!(!NodeFeatures::known().requires_static_remote_key());
+ assert!(InitFeatures::known().supports_static_remote_key());
+ assert!(NodeFeatures::known().supports_static_remote_key());
+ assert!(InitFeatures::known().requires_static_remote_key());
+ assert!(NodeFeatures::known().requires_static_remote_key());
assert!(InitFeatures::known().supports_payment_secret());
assert!(NodeFeatures::known().supports_payment_secret());
{
// Check that the flags are as expected:
// - option_data_loss_protect
- // - var_onion_optin | payment_secret
+ // - var_onion_optin | static_remote_key (req) | payment_secret
// - basic_mpp
assert_eq!(node_features.flags.len(), 3);
assert_eq!(node_features.flags[0], 0b00000010);
- assert_eq!(node_features.flags[1], 0b10000010);
+ assert_eq!(node_features.flags[1], 0b10010010);
assert_eq!(node_features.flags[2], 0b00000010);
}