Send initial_routing_sync-filled Init messages to the first 5 peers
[rust-lightning] / src / ln / msgs.rs
index 869b5115f2ab5362a62b197d63ff684bc3ff3909..bc7c0ed98b3c38052df2fa06f8eccb9078a2bd1f 100644 (file)
@@ -61,9 +61,16 @@ impl LocalFeatures {
                self.flags.len() > 0 && (self.flags[0] & 1) != 0
        }
 
-       pub fn supports_initial_routing_sync(&self) -> bool {
+       pub fn initial_routing_sync(&self) -> bool {
                self.flags.len() > 0 && (self.flags[0] & (1 << 3)) != 0
        }
+       pub fn set_initial_routing_sync(&mut self) {
+               if self.flags.len() == 0 {
+                       self.flags.resize(1, 1 << 3);
+               } else {
+                       self.flags[0] |= 1 << 3;
+               }
+       }
 
        pub fn supports_upfront_shutdown_script(&self) -> bool {
                self.flags.len() > 0 && (self.flags[0] & (3 << 4)) != 0