From c08aa3ac03a1d0669ca46111d02004ba91fb91b7 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Fri, 4 Aug 2023 02:22:07 +0200 Subject: [PATCH] fix undownloaded body (#7966) --- turbo/engineapi/engine_block_downloader/body.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/turbo/engineapi/engine_block_downloader/body.go b/turbo/engineapi/engine_block_downloader/body.go index 312d48d52..0ca0daa28 100644 --- a/turbo/engineapi/engine_block_downloader/body.go +++ b/turbo/engineapi/engine_block_downloader/body.go @@ -101,6 +101,7 @@ func (e *EngineBlockDownloader) downloadAndLoadBodiesSyncronously(tx kv.RwTx, fr toProcess := e.bd.NextProcessingCount() + write := true for i := uint64(0); i < toProcess; i++ { select { case <-logEvery.C: @@ -108,9 +109,12 @@ func (e *EngineBlockDownloader) downloadAndLoadBodiesSyncronously(tx kv.RwTx, fr default: } nextBlock := requestedLow + i - rawBody := e.bd.GetBodyFromCache(nextBlock, true) + rawBody := e.bd.GetBodyFromCache(nextBlock, write) if rawBody == nil { e.bd.NotDelivered(nextBlock) + write = false + } + if !write { continue }