Skip to content

Commit c06d5ce

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 9ef097c commit c06d5ce

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
@@ -590,7 +590,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, TransportImpl
590590
match sync_status {
591591
&mut InitSyncTracker::NoSyncRequested => {},
592592
&mut InitSyncTracker::ChannelsSyncing(c) if c < 0xffff_ffff_ffff_ffff => {
593-
let steps = ((queue_space + 2) / 3) as u8;
593+
let steps = (queue_space / 3) as u8;
594594
let all_messages = self.message_handler.route_handler.get_next_channel_announcements(c, steps);
595595
for &(ref announce, ref update_a_option, ref update_b_option) in all_messages.iter() {
596596
message_queuer.enqueue_message(announce, outbound_queue, &*self.logger);

0 commit comments

Comments
 (0)