]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Fix initial outbound sync infinite loop (XXX: Needs test)
authorMatt Corallo <git@bluematt.me>
Sun, 23 Feb 2020 23:04:03 +0000 (18:04 -0500)
committerMatt Corallo <git@bluematt.me>
Sun, 1 Mar 2020 04:26:16 +0000 (23:26 -0500)
lightning/src/ln/peer_handler.rs

index 6d1e8e7f0a4fd0f4c452823d9f06ccf438708b3c..5e5f1f8b86a5fc467f64d707afc4a0edb9e1861a 100644 (file)
@@ -354,7 +354,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref> PeerManager<Descriptor, CM> where
                                        InitSyncTracker::NoSyncRequested => {},
                                        InitSyncTracker::ChannelsSyncing(c) if c < 0xffff_ffff_ffff_ffff => {
                                                let steps = ((MSG_BUFF_SIZE - peer.pending_outbound_buffer.len() + 2) / 3) as u8;
-                                               let all_messages = self.message_handler.route_handler.get_next_channel_announcements(0, steps);
+                                               let all_messages = self.message_handler.route_handler.get_next_channel_announcements(c, steps);
                                                for &(ref announce, ref update_a, ref update_b) in all_messages.iter() {
                                                        encode_and_send_msg!(announce);
                                                        encode_and_send_msg!(update_a);