Skip to content

Commit 4ea45dd

Browse files
committed
fix: Don't exceed queue soft limit with sync messages
introduced: 8d7b498 The current implementation will add 12 items to a queue with a soft_limit of 10. Fix it to match the expected behavior which is that sync messages do not fill the queue above the soft limit.
1 parent af3cf3d commit 4ea45dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lightning/src/ln/peers/handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, TransportImpl
616616
match sync_status {
617617
&mut InitSyncTracker::NoSyncRequested => {},
618618
&mut InitSyncTracker::ChannelsSyncing(c) if c < 0xffff_ffff_ffff_ffff => {
619-
let steps = ((queue_space + 2) / 3) as u8;
619+
let steps = (queue_space / 3) as u8;
620620
let all_messages = self.message_handler.route_handler.get_next_channel_announcements(c, steps);
621621
for &(ref announce, ref update_a_option, ref update_b_option) in all_messages.iter() {
622622
transport.enqueue_message(announce, outbound_queue, &*self.logger);

0 commit comments

Comments
 (0)