From 3d39ee00f3d1ee98b38d0e665414f07a97f9e12a Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:47:56 +0100 Subject: [PATCH] fix: chunk retry not working --- internal/statesync/chunks.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/statesync/chunks.go b/internal/statesync/chunks.go index 938c3935a..2083b64c8 100644 --- a/internal/statesync/chunks.go +++ b/internal/statesync/chunks.go @@ -104,8 +104,10 @@ func (q *chunkQueue) Enqueue(chunkIDs ...[]byte) { func (q *chunkQueue) enqueue(chunkID bytes.HexBytes) { q.requestQueue = append(q.requestQueue, chunkID) - _, ok := q.items[chunkID.String()] + chunk, ok := q.items[chunkID.String()] if ok { + // If the chunk is already in the queue, reset its status to initStatus to retry fetching it. + chunk.status = initStatus return } q.items[chunkID.String()] = &chunkItem{