From 34112a9c4c1db83d05c7ba530c12331ce9f4ee0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?rich=CE=9Brd?= Date: Mon, 12 Aug 2024 13:32:31 -0400 Subject: [PATCH] Update wakuv2/missing_messages.go Co-authored-by: Igor Sirotin --- wakuv2/missing_messages.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wakuv2/missing_messages.go b/wakuv2/missing_messages.go index 5ca7fac68..3fb797e12 100644 --- a/wakuv2/missing_messages.go +++ b/wakuv2/missing_messages.go @@ -241,8 +241,7 @@ func (w *Waku) fetchMessagesBatch(missingHistoryRequest TopicInterest, batchFrom // Split into batches for i := 0; i < len(missingHashes); i += maxHashQueryLength { j := i + maxHashQueryLength - if j > len(missingHashes) { - j = len(missingHashes) + j = math.Min(j, len(missingHashes)) } wg.Add(1)