Skip to content

Commit f5f3942

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 fc4e86d commit f5f3942

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

0 commit comments

Comments
 (0)